From: ika Date: Mon, 20 Apr 2020 12:09:27 +0000 (+0300) Subject: # Add pair_representation_relationship entity X-Git-Url: http://git.dev.opencascade.org/gitweb/?a=commitdiff_plain;h=3e620da9169377958ab136267ef18e9dd9d1ed15;p=occt-copy.git # Add pair_representation_relationship entity --- diff --git a/src/RWStepAP214/RWStepAP214_GeneralModule.cxx b/src/RWStepAP214/RWStepAP214_GeneralModule.cxx index 991fbd9e8d..a1be5d63eb 100644 --- a/src/RWStepAP214/RWStepAP214_GeneralModule.cxx +++ b/src/RWStepAP214/RWStepAP214_GeneralModule.cxx @@ -1382,6 +1382,7 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_GeneralModule,StepData_GeneralModule) #include #include #include +#include #include #include #include @@ -1451,6 +1452,7 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_GeneralModule,StepData_GeneralModule) #include #include #include +#include #include #include #include @@ -5770,6 +5772,13 @@ void RWStepAP214_GeneralModule::FillSharedCase(const Standard_Integer CN, tool.Share(anent, iter); } break; + case 788: + { + DeclareAndCast(StepKinematics_PairRepresentationRelationship, anent, ent); + RWStepKinematics_RWPairRepresentationRelationship tool; + tool.Share(anent, iter); + } + break; break; default : break; @@ -7988,6 +7997,9 @@ Standard_Boolean RWStepAP214_GeneralModule::NewVoid case 787: ent = new StepKinematics_UniversalPairWithRange; break; + case 788: + ent = new StepKinematics_PairRepresentationRelationship; + break; default: @@ -8656,6 +8668,7 @@ Standard_Integer RWStepAP214_GeneralModule::CategoryNumber case 785: return cataux; case 786: return cataux; case 787: return cataux; + case 788: return cataux; default : break; diff --git a/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx b/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx index be5ee61296..7403443517 100644 --- a/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx +++ b/src/RWStepAP214/RWStepAP214_ReadWriteModule.cxx @@ -1429,6 +1429,7 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule) #include #include #include +#include #include #include #include @@ -1497,6 +1498,7 @@ IMPLEMENT_STANDARD_RTTIEXT(RWStepAP214_ReadWriteModule,StepData_ReadWriteModule) #include #include #include +#include #include #include #include @@ -2208,6 +2210,7 @@ static TCollection_AsciiString Reco_LowOrderKinematicPairValue("LOW_ORDER_KINEMA static TCollection_AsciiString Reco_LowOrderKinematicPairWithRange("LOW_ORDER_KINEMATIC_PAIR_WITH_RANGE"); static TCollection_AsciiString Reco_MechanismRepresentation("MECHANISM_REPRESENTATION"); static TCollection_AsciiString Reco_OrientedJoint("ORIENTED_JOINT"); +static TCollection_AsciiString Reco_PairRepresentationRelationship("PAIR_REPRESENTATION_RELATIONSHIP"); static TCollection_AsciiString Reco_PlanarCurvePair("PLANAR_CURVE_PAIR"); static TCollection_AsciiString Reco_PlanarCurvePairRange("PLANAR_CURVE_PAIR_RANGE"); static TCollection_AsciiString Reco_PlanarPair("PLANAR_PAIR"); @@ -2978,7 +2981,7 @@ RWStepAP214_ReadWriteModule::RWStepAP214_ReadWriteModule () typenums.Bind(Reco_UniversalPair, 785); typenums.Bind(Reco_UniversalPairValue, 786); typenums.Bind(Reco_UniversalPairWithRange, 787); - + typenums.Bind(Reco_PairRepresentationRelationship, 788); // SHORT NAMES @@ -4903,6 +4906,7 @@ const TCollection_AsciiString& RWStepAP214_ReadWriteModule::StepType case 785: return Reco_UniversalPair; case 786: return Reco_UniversalPairValue; case 787: return Reco_UniversalPairWithRange; + case 788: return Reco_PairRepresentationRelationship; default : return PasReco; @@ -10280,8 +10284,13 @@ void RWStepAP214_ReadWriteModule::ReadStep(const Standard_Integer CN, tool.ReadStep(data, num, ach, anent); } break; - - + case 788: + { + DeclareAndCast(StepKinematics_PairRepresentationRelationship, anent, ent); + RWStepKinematics_RWPairRepresentationRelationship tool; + tool.ReadStep(data, num, ach, anent); + } + break; default: ach->AddFail("Type Mismatch when reading - Entity"); @@ -15614,7 +15623,13 @@ void RWStepAP214_ReadWriteModule::WriteStep(const Standard_Integer CN, tool.WriteStep(SW, anent); } break; - + case 788: + { + DeclareAndCast(StepKinematics_PairRepresentationRelationship, anent, ent); + RWStepKinematics_RWPairRepresentationRelationship tool; + tool.WriteStep(SW, anent); + } + break; default: return; diff --git a/src/RWStepKinematics/FILES b/src/RWStepKinematics/FILES index 66edd25fc0..c5981f704a 100644 --- a/src/RWStepKinematics/FILES +++ b/src/RWStepKinematics/FILES @@ -38,6 +38,8 @@ RWStepKinematics_RWMechanismRepresentation.cxx RWStepKinematics_RWMechanismRepresentation.hxx RWStepKinematics_RWOrientedJoint.cxx RWStepKinematics_RWOrientedJoint.hxx +RWStepKinematics_RWPairRepresentationRelationship.cxx +RWStepKinematics_RWPairRepresentationRelationship.hxx RWStepKinematics_RWPlanarCurvePair.cxx RWStepKinematics_RWPlanarCurvePair.hxx RWStepKinematics_RWPlanarCurvePairRange.cxx diff --git a/src/RWStepKinematics/RWStepKinematics_RWPairRepresentationRelationship.cxx b/src/RWStepKinematics/RWStepKinematics_RWPairRepresentationRelationship.cxx new file mode 100644 index 0000000000..e5cfeb5c62 --- /dev/null +++ b/src/RWStepKinematics/RWStepKinematics_RWPairRepresentationRelationship.cxx @@ -0,0 +1,141 @@ +// Created on : Mon Apr 20 13:08:26 2020 +// Created by: Irina KRYLOVA +// Generator: Express (EXPRESS -> CASCADE/XSTEP Translator) V2.0 +// Copyright (c) Open CASCADE 2020 +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +//======================================================================= +//function : RWStepKinematics_RWPairRepresentationRelationship +//purpose : +//======================================================================= + +RWStepKinematics_RWPairRepresentationRelationship::RWStepKinematics_RWPairRepresentationRelationship() {} + + +//======================================================================= +//function : ReadStep +//purpose : +//======================================================================= + +void RWStepKinematics_RWPairRepresentationRelationship::ReadStep (const Handle(StepData_StepReaderData)& data, + const Standard_Integer num, + Handle(Interface_Check)& ach, + const Handle(StepKinematics_PairRepresentationRelationship)& ent) const +{ + // Check number of parameters + if ( ! data->CheckNbParams(num,6,ach,"pair_representation_relationship") ) return; + + // Inherited fields of RepresentationItem + + Handle(TCollection_HAsciiString) aRepresentationItem_Name; + data->ReadString (num, 1, "representation_item.name", ach, aRepresentationItem_Name); + + // Inherited fields of RepresentationRelationship + + Handle(TCollection_HAsciiString) aRepresentationRelationship_Name; + data->ReadString (num, 2, "representation_relationship.name", ach, aRepresentationRelationship_Name); + + Handle(TCollection_HAsciiString) aRepresentationRelationship_Description; + Standard_Boolean hasRepresentationRelationship_Description = Standard_True; + if ( data->IsParamDefined (num,3) ) { + data->ReadString (num, 3, "representation_relationship.description", ach, aRepresentationRelationship_Description); + } + else { + hasRepresentationRelationship_Description = Standard_False; + aRepresentationRelationship_Description.Nullify(); + } + + StepRepr_RepresentationOrRepresentationReference aRepresentationRelationship_Rep1; + data->ReadEntity (num, 4, "representation_relationship.rep1", ach, aRepresentationRelationship_Rep1); + + StepRepr_RepresentationOrRepresentationReference aRepresentationRelationship_Rep2; + data->ReadEntity (num, 5, "representation_relationship.rep2", ach, aRepresentationRelationship_Rep2); + + // Inherited fields of RepresentationRelationshipWithTransformation + + StepRepr_Transformation aRepresentationRelationshipWithTransformation_TransformationOperator; + data->ReadEntity (num, 6, "representation_relationship_with_transformation.transformation_operator", ach, aRepresentationRelationshipWithTransformation_TransformationOperator); + + // Initialize entity + ent->Init(aRepresentationItem_Name, + aRepresentationRelationship_Name, + hasRepresentationRelationship_Description, + aRepresentationRelationship_Description, + aRepresentationRelationship_Rep1, + aRepresentationRelationship_Rep2, + aRepresentationRelationshipWithTransformation_TransformationOperator); +} + +//======================================================================= +//function : WriteStep +//purpose : +//======================================================================= + +void RWStepKinematics_RWPairRepresentationRelationship::WriteStep (StepData_StepWriter& SW, + const Handle(StepKinematics_PairRepresentationRelationship)& ent) const +{ + + // Own fields of RepresentationItem + + SW.Send (ent->Name()); + + // Own fields of RepresentationRelationship + + SW.Send (ent->Name()); + + if ( ent->RepresentationRelationshipWithTransformation()->HasDescription() ) { + SW.Send(ent->RepresentationRelationshipWithTransformation()->Description()); + } + else SW.SendUndef(); + + SW.Send(ent->RepresentationRelationshipWithTransformation()->Rep1()); + + SW.Send(ent->RepresentationRelationshipWithTransformation()->Rep2()); + + // Inherited fields of RepresentationRelationshipWithTransformation + + SW.Send (ent->RepresentationRelationshipWithTransformation()->TransformationOperator().Value()); +} + +//======================================================================= +//function : Share +//purpose : +//======================================================================= + +void RWStepKinematics_RWPairRepresentationRelationship::Share (const Handle(StepKinematics_PairRepresentationRelationship)& ent, + Interface_EntityIterator& iter) const +{ + + // Inherited fields of RepresentationItem + + // Inherited fields of RepresentationRelationship + + iter.AddItem(ent->RepresentationRelationshipWithTransformation()->Rep1()); + + iter.AddItem(ent->RepresentationRelationshipWithTransformation()->Rep2()); + + // Inherited fields of RepresentationRelationshipWithTransformation + + iter.AddItem (ent->RepresentationRelationshipWithTransformation()->TransformationOperator().Value()); +} diff --git a/src/RWStepKinematics/RWStepKinematics_RWPairRepresentationRelationship.hxx b/src/RWStepKinematics/RWStepKinematics_RWPairRepresentationRelationship.hxx new file mode 100644 index 0000000000..c72c3b3d1a --- /dev/null +++ b/src/RWStepKinematics/RWStepKinematics_RWPairRepresentationRelationship.hxx @@ -0,0 +1,46 @@ +// Created on : Mon Apr 20 13:08:26 2020 +// Created by: Irina KRYLOVA +// Generator: Express (EXPRESS -> CASCADE/XSTEP Translator) V2.0 +// Copyright (c) Open CASCADE 2020 +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _RWStepKinematics_RWPairRepresentationRelationship_HeaderFile_ +#define _RWStepKinematics_RWPairRepresentationRelationship_HeaderFile_ + +#include +#include +#include + +class StepData_StepReaderData; +class Interface_Check; +class StepData_StepWriter; +class Interface_EntityIterator; +class StepKinematics_PairRepresentationRelationship; + +//! Read & Write tool for PairRepresentationRelationship +class RWStepKinematics_RWPairRepresentationRelationship +{ +public: + + DEFINE_STANDARD_ALLOC + + Standard_EXPORT RWStepKinematics_RWPairRepresentationRelationship(); + + Standard_EXPORT void ReadStep(const Handle(StepData_StepReaderData)& data, const Standard_Integer num, Handle(Interface_Check)& ach, const Handle(StepKinematics_PairRepresentationRelationship)& ent) const; + + Standard_EXPORT void WriteStep(StepData_StepWriter& SW, const Handle(StepKinematics_PairRepresentationRelationship)& ent) const; + + Standard_EXPORT void Share(const Handle(StepKinematics_PairRepresentationRelationship)& ent, Interface_EntityIterator& iter) const; + +}; +#endif // _RWStepKinematics_RWPairRepresentationRelationship_HeaderFile_ diff --git a/src/StepAP214/StepAP214_Protocol.cxx b/src/StepAP214/StepAP214_Protocol.cxx index 0d8ce1ebe4..39f671ef71 100644 --- a/src/StepAP214/StepAP214_Protocol.cxx +++ b/src/StepAP214/StepAP214_Protocol.cxx @@ -774,6 +774,7 @@ static Standard_CString schemaAP242DIS = "AP242_MANAGED_MODEL_BASED_3D_ENGINEERI #include #include #include +#include #include #include #include @@ -1599,6 +1600,7 @@ StepAP214_Protocol::StepAP214_Protocol () types.Bind(STANDARD_TYPE(StepKinematics_UniversalPair), 785); types.Bind(STANDARD_TYPE(StepKinematics_UniversalPairValue), 786); types.Bind(STANDARD_TYPE(StepKinematics_UniversalPairWithRange), 787); + types.Bind(STANDARD_TYPE(StepKinematics_PairRepresentationRelationship), 788); } diff --git a/src/StepKinematics/FILES b/src/StepKinematics/FILES index fdcfa7c065..d092dcc017 100644 --- a/src/StepKinematics/FILES +++ b/src/StepKinematics/FILES @@ -49,6 +49,8 @@ StepKinematics_MechanismRepresentation.cxx StepKinematics_MechanismRepresentation.hxx StepKinematics_OrientedJoint.cxx StepKinematics_OrientedJoint.hxx +StepKinematics_PairRepresentationRelationship.cxx +StepKinematics_PairRepresentationRelationship.hxx StepKinematics_PairValue.cxx StepKinematics_PairValue.hxx StepKinematics_PlanarCurvePair.cxx diff --git a/src/StepKinematics/StepKinematics_PairRepresentationRelationship.cxx b/src/StepKinematics/StepKinematics_PairRepresentationRelationship.cxx new file mode 100644 index 0000000000..4201bf278a --- /dev/null +++ b/src/StepKinematics/StepKinematics_PairRepresentationRelationship.cxx @@ -0,0 +1,71 @@ +// Created on : Mon Apr 20 13:08:26 2020 +// Created by: Irina KRYLOVA +// Generator: Express (EXPRESS -> CASCADE/XSTEP Translator) V2.0 +// Copyright (c) Open CASCADE 2020 +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#include + +IMPLEMENT_STANDARD_RTTIEXT(StepKinematics_PairRepresentationRelationship, StepGeom_GeometricRepresentationItem) + +//======================================================================= +//function : StepKinematics_PairRepresentationRelationship +//purpose : +//======================================================================= + +StepKinematics_PairRepresentationRelationship::StepKinematics_PairRepresentationRelationship () +{ +} + +//======================================================================= +//function : Init +//purpose : +//======================================================================= + +void StepKinematics_PairRepresentationRelationship::Init (const Handle(TCollection_HAsciiString)& theRepresentationItem_Name, + const Handle(TCollection_HAsciiString)& theRepresentationRelationship_Name, + const Standard_Boolean /*hasRepresentationRelationship_Description*/, + const Handle(TCollection_HAsciiString)& theRepresentationRelationship_Description, + const StepRepr_RepresentationOrRepresentationReference& theRepresentationRelationship_Rep1, + const StepRepr_RepresentationOrRepresentationReference& theRepresentationRelationship_Rep2, + const StepRepr_Transformation& theRepresentationRelationshipWithTransformation_TransformationOperator) +{ + StepGeom_GeometricRepresentationItem::Init(theRepresentationItem_Name); + myRepresentationRelationshipWithTransformation = new StepRepr_RepresentationRelationshipWithTransformation; + myRepresentationRelationshipWithTransformation->Init(theRepresentationRelationship_Name, + /*hasRepresentationRelationship_Description,*/ + theRepresentationRelationship_Description, + theRepresentationRelationship_Rep1.Representation(), + theRepresentationRelationship_Rep2.Representation(), + theRepresentationRelationshipWithTransformation_TransformationOperator); +} + +//======================================================================= +//function : RepresentationRelationshipWithTransformation +//purpose : +//======================================================================= + +Handle(StepRepr_RepresentationRelationshipWithTransformation) StepKinematics_PairRepresentationRelationship::RepresentationRelationshipWithTransformation () const +{ + return myRepresentationRelationshipWithTransformation; +} + +//======================================================================= +//function : SetRepresentationRelationshipWithTransformation +//purpose : +//======================================================================= + +void StepKinematics_PairRepresentationRelationship::SetRepresentationRelationshipWithTransformation (const Handle(StepRepr_RepresentationRelationshipWithTransformation)& theRepresentationRelationshipWithTransformation) +{ + myRepresentationRelationshipWithTransformation = theRepresentationRelationshipWithTransformation; +} diff --git a/src/StepKinematics/StepKinematics_PairRepresentationRelationship.hxx b/src/StepKinematics/StepKinematics_PairRepresentationRelationship.hxx new file mode 100644 index 0000000000..feb6912d98 --- /dev/null +++ b/src/StepKinematics/StepKinematics_PairRepresentationRelationship.hxx @@ -0,0 +1,59 @@ +// Created on : Mon Apr 20 13:08:26 2020 +// Created by: Irina KRYLOVA +// Generator: Express (EXPRESS -> CASCADE/XSTEP Translator) V2.0 +// Copyright (c) Open CASCADE 2020 +// +// This file is part of Open CASCADE Technology software library. +// +// This library is free software; you can redistribute it and/or modify it under +// the terms of the GNU Lesser General Public License version 2.1 as published +// by the Free Software Foundation, with special exception defined in the file +// OCCT_LGPL_EXCEPTION.txt. Consult the file LICENSE_LGPL_21.txt included in OCCT +// distribution for complete text of the license and disclaimer of any warranty. +// +// Alternatively, this file may be used under the terms of Open CASCADE +// commercial license or contractual agreement. + +#ifndef _StepKinematics_PairRepresentationRelationship_HeaderFile_ +#define _StepKinematics_PairRepresentationRelationship_HeaderFile_ + +#include +#include +#include + +#include +#include +#include +#include + +DEFINE_STANDARD_HANDLE(StepKinematics_PairRepresentationRelationship, StepGeom_GeometricRepresentationItem) + +//! Representation of STEP entity PairRepresentationRelationship +class StepKinematics_PairRepresentationRelationship : public StepGeom_GeometricRepresentationItem +{ +public : + + //! default constructor + Standard_EXPORT StepKinematics_PairRepresentationRelationship(); + + //! Initialize all fields (own and inherited) + Standard_EXPORT void Init(const Handle(TCollection_HAsciiString)& theRepresentationItem_Name, + const Handle(TCollection_HAsciiString)& theRepresentationRelationship_Name, + const Standard_Boolean hasRepresentationRelationship_Description, + const Handle(TCollection_HAsciiString)& theRepresentationRelationship_Description, + const StepRepr_RepresentationOrRepresentationReference& theRepresentationRelationship_Rep1, + const StepRepr_RepresentationOrRepresentationReference& theRepresentationRelationship_Rep2, + const StepRepr_Transformation& theRepresentationRelationshipWithTransformation_TransformationOperator); + + //! Returns data for supertype RepresentationRelationshipWithTransformation + Standard_EXPORT Handle(StepRepr_RepresentationRelationshipWithTransformation) RepresentationRelationshipWithTransformation() const; + //! Sets data for supertype RepresentationRelationshipWithTransformation + Standard_EXPORT void SetRepresentationRelationshipWithTransformation (const Handle(StepRepr_RepresentationRelationshipWithTransformation)& theRepresentationRelationshipWithTransformation); + +DEFINE_STANDARD_RTTIEXT(StepKinematics_PairRepresentationRelationship, StepGeom_GeometricRepresentationItem) + +private: + Handle(StepRepr_RepresentationRelationshipWithTransformation) myRepresentationRelationshipWithTransformation; //!< supertype + +}; +#endif // _StepKinematics_PairRepresentationRelationship_HeaderFile_