您好,欢迎访问三七文档
当前位置:首页 > 商业/管理/HR > 经营企划 > CAA_V5_For_CATIA_Foundations_Exercises教程
CopyrightDASSAULTSYSTEMES20011CAAV5ForCATIAFoundationsExercisesCATIATrainingExercisesVersion5Release6March2001FOR-CAT-E-CAA-F-V5R6CopyrightDASSAULTSYSTEMES20012CAAV5ForCATIAFoundationsExercisesPrerequisites:CATIAV5userinterfaceprinciples(Mandatory)C++industrialprogrammingpractice(Mandatory)COM(MicrosoftObjectModel)notions(Nicetohave)MicrosoftDeveloperStudiopractice(Nicetohave)ObjectivesoftheExercisesIntheseexercisesyouwillpracticetheCAAV5developmentplatform,usethefoundationcomponents,anddevelopinthearchitectureofaCATIAV5applicationTargetedaudienceC++ProgrammerswhointendtodevelopCAAApplications(interactiveorbatch)5daysCopyrightDASSAULTSYSTEMES20013TableofContents1.ObjectModelerExercisesExercise1:UsingbehaviorthroughinterfaceExercise2:DefinedifferentbehaviorswiththesameinterfaceExercise3:ExtendingPoint’sbehaviorthroughExtensionmechanism2.BasicSketcherExercisesBasicSketcherOverviewPreparingtheEnvironmentUsingtheBasicSketcherExtendingtheBasicSketcherCopyrightDASSAULTSYSTEMES20014CAAV5ObjectModelerExercisesCATIATrainingExercisesVersion5Release6March2001FOR-CAT-E-XXX-FX-V5R6CopyrightDASSAULTSYSTEMES20015TableofContents1.Exercise1:UsingbehaviorthroughinterfaceSetuptheenvironmentInstantiateobjectsManipulateobjectsthroughinterfaces2.Exercise2:DefinedifferentbehaviorswiththesameinterfaceImplementinterfacesQueryInterfaceonanobject3.Exercise3:ExtendingPoint’sbehaviorthroughExtensionmechanismExtendobject’sbehaviorOntheseexercises,youwillnotmanipulateCATIAMechanicalObject!CopyrightDASSAULTSYSTEMES20016Exercise1UsingbehaviorthroughinterfaceInthisexerciseyouwillusefactoryconceptandmanipulatebehaviorthroughinterfaces60minGetX()GetY()CAAIPointInterfaceCreatePoint()CAAOmtModelFactoryImplementationGetX()GetY()CAAOmtPointdouble_x,_yCopyrightDASSAULTSYSTEMES20017DesignIntent:UsingbehaviorthroughinterfaceDefinedifferentbehaviorswiththesameinterface•Setuptheenvironment•Instantiateobjects•ManipulateobjectsthroughinterfacesCopyrightDASSAULTSYSTEMES20018Setuptheenvironment:•OpenMsDevandtheOMBaseExerciseworkspace•SelectallframeworksDoItYourselfOpenMsDevOpentheOMBaseExerciseworkspaceSelectallframeworksCopyrightDASSAULTSYSTEMES20019Setuptheenvironment:•DefineCATIAAsprerequisiteworkspace•Buildtheapplication•UpdatetheRunTimeViewDoItYourselfDefineCATIAasprerequisiteworkspaceBuildtheapplicationUpdatetheRunTimeViewCopyrightDASSAULTSYSTEMES200110Instantiateobjects:•IntheCAAModelTestmodule,openthebatchprogram(CAAOmtModelTest)•Createaninstanceofthefactory•New….•UsethisobjecttocreateaPoint•CreatePoint(….)•Retrieveanddisplaypoint’scoordinates•GetX(),GetY()Manipulateobjectsthroughinterfaces:•Buildthebatchmodule•SetasactivetheCAAModelTestmodule•RunitDoItYourselfSetasactivetheCAAModelTestmoduleRunitBuildthebatchmoduleCopyrightDASSAULTSYSTEMES200111Exercise2DefinedifferentbehaviorswiththesameinterfaceInthisexerciseyouwillimplement2interfacesonthesameobject90minGetX()GetY()CAAIPointGetStartPoint()GetEndPoint()CAAILineInterfacesCreatePoint()CreateLine()CAAOmtModelFactoryImplementationsGetStartPoint(),GetEndPoint()GetX(),GetY()CAAOmtLineCAAIPoint*_startPointCAAIPoint*_endPointCopyrightDASSAULTSYSTEMES200112DesignIntent:Definedifferentbehaviorswiththesameinterface•CreatetheCAAILineInterface•ImplementCAAILineandCAAIPointinterfacesonthesameobject•AddCreateLinemethodintheCAAModelFactoryobjectandimplementit•UsenewinterfaceinthebatchprogramCopyrightDASSAULTSYSTEMES200113CreatetheCAAILineInterface:•OpenMsDevandtheOMBaseExerciseworkspaceyoumodified•CreatetheCAAILineInterface•SetasactivetheInterfaces’framework(CAAOmtModelInterfaces)•UsethewizardtocreatetheCAAILineInterfaceanddefinethevirtualmethods:•virtualHRESULTGetStartPoint(CAAIPoint**oStartPoint)=0;•virtualHRESULTGetEndPoint(CAAIPoint**oEndPoint)=0;•UpdateyourProject•Buildinterfaces’framework•UpdatetheRunTimeViewDoItYourselfCreatetheCAAILineInterfaceOpenMsDevCopyrightDASSAULTSYSTEMES200114DoItYourselfImplementCAAILineandCAAIpointinterfacesonthesameobjectImplementCAAILineandCAAIPointinterfacesonthesameobject:•Setasactivetheimplementation’smodule(CAAOmtModelImpl)•UsetheNewImplementationwizardtoimplementationCAAILineandCAAIPointonthesameobject(declaredasprivate)•Define2Points(CAAIPoint)asdatamembers•Nosetmethodfordatamemberssocreateyourconstructor•CAAOmtLine(CAAIPoint&iStartPoint,CAAIPoint&iEndPoint);•GetX()andGetY()methodsreturnmiddleline‘scoordinates•Buildimplementation’sframework•UpdatetheRunTimeViewCopyrightDASSAULTSYSTEMES200115AddCreateLinemethodintheCAAModelFactoryobjectandimplementit:•AddCreateLinemethodintheCAAModelFactoryobjectandimplementit•HRESULTCreateLine(CAAIPoint&ipiStartPoint,CAAIPoint&ipiEndPoint,CAAILine**opiNewLine);•Buildimplementation’sframework•UpdatetheRunTimeViewUsenewinterfaceinthebatchprogram:•SetasactivetheCAAModelTestmodule•Inthebatchprogramcreateanotherpointandaline.•VerifythattheGetXandGetYmethodsreturnthegoodvalues.DoItYourselfRunthenewbatchCopyrightDASSAULTSYSTEMES200116ComponentExercise3ExtendingPoint’sbehaviorthroughExtensionmechanismInthisexerciseyouwillextendanobject60minGet
本文标题:CAA_V5_For_CATIA_Foundations_Exercises教程
链接地址:https://www.777doc.com/doc-693491 .html