== 1
~~~~~
-@subsubsection occt_draw_8_10_37 XRemovePairValues
+@subsubsection occt_draw_8_10_38 XRemovePairValues
Syntax:
~~~~~
@subsection occt_xde_1_11 Kinematics
Kinematic data storage is realized according to ISO 10303-105:2019(E) and STEP Schema AP242 2019 year.
-All kinematic data is divided onto mechanisms each mechanism has its graph of links (references to shapes), joints (kinematic pair information) and (optional) states(sets of kinematic values).
+All kinematic data is divided onto mechanisms each mechanism has its graph of links (references to shapes), joints (kinematic pair information) and (optional) states (sets of kinematic values).
Each joint corresponds to one kinematic pair from the list:
* Low order pairs
- fully constrained pair (no DOF);
The kinematic value consist of
* reference to joint;
-* paramters;
+* parameters.
All mentioned data depends on the kinematic pair type.
@subsection occt_xde_2_11 Kinematics
-In XDE Document Kinematics is managed via *XCAFDoc_KinematicTool*. The Kinematic pair entities are described by two attributes
-*XCAFDoc_KinematicPair* and *XCAFDoc_KinematicPairValue (optional)*. The second attribute is a dependant attribute,
-it cannot be assigned to label without the main attribute or to a label with the main attribute of another kinematic pair type.
+In XDE Document Kinematics is managed via *XCAFDoc_KinematicTool*.
@subsubsection occt_xde_2_11_1 Creation
All kinematic data refers to the mechanism, so, first of all, it needs to *AddMechanism*,
this method creates a new mechanism and two empty subfolders for links and joints.
The next step is specifying of links (mechanism details) via *AddLink* and *SetLink* commands.
-The last step of kinematic graph creation is adding of joints with using *AddJoint* and *SetJoint* commands.
+The next step is adding of joints with using *AddJoint* and *SetJoint* commands.
+The last step of kinematic graph creationp is specifying of states (optional) via *AddState*, *AddValue* and *SetValue* commands.
Here is an example of creating a new mechanism and adding a new joint with two links:
~~~~~
- *IsLink* : checking for references to shape of the given link;
- *IsJoint* : checking for references to end and start link of the given joint;
- *IsValue* : checking for conteined assigning data.
+- *IsState* : checking for main label of value;
To retrieve current graph state use the next methods:
- *GetMechanisms* : retrieves all mechanisms labels;
}
if (aCDKLR.IsNull())
continue;
- Handle(StepRepr_PropertyDefinition) aPD =
- Handle(StepRepr_PropertyDefinition)::DownCast(aCDKLR->RepresentedProductRelation());
+ Handle(StepRepr_PropertyDefinition) aPD = aCDKLR->RepresentedProductRelation();
if (aPD.IsNull())
continue;
TDF_Label aShapeLabel;
anObj->SetUpperLimitPitch(aPointOnSurfacePairWithRange->UpperLimitPitch());
anObj->SetLowLimitRoll(aPointOnSurfacePairWithRange->LowerLimitRoll());
anObj->SetUpperLimitRoll(aPointOnSurfacePairWithRange->UpperLimitRoll());
- anObj->SetTrimmedSurface(StepToGeom::MakeRectangularTrimmedSurface(aPointOnSurfacePairWithRange->RangeOnPairSurface()));
+ anObj->SetSurface(StepToGeom::MakeSurface(aPointOnSurfacePairWithRange->RangeOnPairSurface()));
}
else if (theKP->IsKind(STANDARD_TYPE(StepKinematics_PointOnPlanarCurvePairWithRange)))
{
anObj->SetUpperLimitPitch(aPointOnPlanarCurvePairWithRange->UpperLimitPitch());
anObj->SetLowLimitRoll(aPointOnPlanarCurvePairWithRange->LowerLimitRoll());
anObj->SetUpperLimitRoll(aPointOnPlanarCurvePairWithRange->UpperLimitRoll());
- anObj->SetTrimmedCurve(StepToGeom::MakeTrimmedCurve(aPointOnPlanarCurvePairWithRange->RangeOnPairCurve()));
+ anObj->SetCurve(StepToGeom::MakeCurve(aPointOnPlanarCurvePairWithRange->RangeOnPairCurve()));
}
else if (theKP->IsKind(STANDARD_TYPE(StepKinematics_PlanarCurvePairRange)))
{
else if (theKP->IsKind(STANDARD_TYPE(StepKinematics_LinearFlexibleAndPlanarCurvePair)))
{
Handle(StepKinematics_LinearFlexibleAndPlanarCurvePair) aLinearFlexibleAndPlanarCurvePair = Handle(StepKinematics_LinearFlexibleAndPlanarCurvePair)::DownCast(theKP);
- aHighOrderPairObject->SetFirstCurve(StepToGeom::MakeCurve(aLinearFlexibleAndPlanarCurvePair->PairCurve()));
+ aHighOrderPairObject->SetCurve(StepToGeom::MakeCurve(aLinearFlexibleAndPlanarCurvePair->PairCurve()));
aHighOrderPairObject->SetOrientation(aLinearFlexibleAndPlanarCurvePair->Orientation());
}
}
#include <BRep_Builder.hxx>
#include <GeomToStep_MakeAxis2Placement3d.hxx>
-#include <Geom_RectangularTrimmedSurface.hxx>
#include <GeomToStep_MakeCartesianPoint.hxx>
-#include <Geom_TrimmedCurve.hxx>
#include <HeaderSection_FileSchema.hxx>
#include <Interface_EntityIterator.hxx>
#include <Interface_Static.hxx>
#include <TopTools_MapOfShape.hxx>
#include <GeomToStep_MakeSurface.hxx>
#include <GeomToStep_MakeCurve.hxx>
-#include <GeomToStep_MakeRectangularTrimmedSurface.hxx>
#include <TopTools_SequenceOfShape.hxx>
#include <Transfer_ActorOfFinderProcess.hxx>
#include <Transfer_Binder.hxx>
//function : createKinematicJoint
//purpose : auxilary
//=======================================================================
-static Standard_Boolean createKinematicJoint(const Handle(Transfer_FinderProcess)& theFP,
- const Handle(XCAFDoc_KinematicTool)& theKTool,
- const Interface_Graph& theGraph,
+static Standard_Boolean createKinematicJoint(const Handle(XCAFDoc_KinematicTool)& theKTool,
const TDF_Label& theLabelJoint,
const Handle(XCAFKinematics_PairObject)& theKinPairObj,
const NCollection_IndexedDataMap<TDF_Label, Handle(StepKinematics_KinematicLinkRepresentation), TDF_LabelMapHasher>& theMapOfLinks,
{
case(XCAFKinematics_PairType_PointOnSurface):
{
- if (isRanged)
+ GeomToStep_MakeSurface aMaker(aHighOrderPairObject->Surface());
+ Handle(StepGeom_Surface) aPairSurface = aMaker.Value();
+ if (isRanged && !aPairSurface.IsNull() &&
+ aPairSurface->IsKind(STANDARD_TYPE(StepGeom_RectangularTrimmedSurface)))
{
- GeomToStep_MakeSurface aMaker(aHighOrderPairObject->Surface());
- Handle(StepGeom_Surface) aPairSurface = aMaker.Value();
Standard_Real aLowerLimitYaw = aHighOrderPairObject->LowLimitYaw();
Standard_Real aUpperLimitYaw = aHighOrderPairObject->UpperLimitYaw();
Standard_Real aLowerLimitPitch = aHighOrderPairObject->LowLimitPitch();
Standard_Real aUpperLimitPitch = aHighOrderPairObject->UpperLimitPitch();
Standard_Real aLowerLimitRoll = aHighOrderPairObject->LowLimitRoll();
Standard_Real aUpperLimitRoll = aHighOrderPairObject->UpperLimitRoll();
- GeomToStep_MakeRectangularTrimmedSurface aMakerTrimmered(aHighOrderPairObject->TrimmedSurface());
- Handle(StepGeom_RectangularTrimmedSurface) aRangeOnPairSurface = aMakerTrimmered.Value();
+ GeomToStep_MakeSurface aMakerSurface(aHighOrderPairObject->Surface());
+ Handle(StepGeom_RectangularTrimmedSurface) aRangeOnPairSurface = Handle(StepGeom_RectangularTrimmedSurface)::DownCast(aMakerSurface.Value());
theKinematicPair = new StepKinematics_PointOnSurfacePairWithRange;
Handle(StepKinematics_PointOnSurfacePairWithRange) aPointOnSurfacePairWithRange = Handle(StepKinematics_PointOnSurfacePairWithRange)::DownCast(theKinematicPair);
aPointOnSurfacePairWithRange->Init(aPairName, aPairName, hasDescription,
aDescription, theTransformItem1, theTransformItem2, theJoint, aPairSurface,aRangeOnPairSurface, Standard_True, aLowerLimitYaw, Standard_True, aUpperLimitYaw, Standard_True,
aLowerLimitPitch, Standard_True, aUpperLimitPitch, Standard_True, aLowerLimitRoll, Standard_True, aUpperLimitRoll);
}
- else
+ else
{
theKinematicPair = new StepKinematics_PointOnSurfacePair;
- GeomToStep_MakeSurface aMaker(aHighOrderPairObject->Surface());
- Handle(StepGeom_Surface) aPairSurface = aMaker.Value();
Handle(StepKinematics_PointOnSurfacePair) aPointOnSurface = Handle(StepKinematics_PointOnSurfacePair)::DownCast(theKinematicPair);
aPointOnSurface->Init(aPairName, aPairName, hasDescription,
- aDescription, theTransformItem1, theTransformItem2, theJoint,aPairSurface);
+ aDescription, theTransformItem1, theTransformItem2, theJoint, aPairSurface);
}
break;
}
GeomToStep_MakeCurve aMaker(aHighOrderPairObject->Curve());
Handle(StepGeom_Curve) aPairCurve = aMaker.Value();
Standard_Boolean anOrientation = aHighOrderPairObject->Orientation();
- if (isRanged)
+ if (isRanged && !aPairCurve.IsNull() &&
+ aPairCurve->IsKind(STANDARD_TYPE(StepGeom_TrimmedCurve)))
{
Standard_Real aLowerLimitYaw = aHighOrderPairObject->LowLimitYaw();
Standard_Real aUpperLimitYaw = aHighOrderPairObject->UpperLimitYaw();
Standard_Real aLowerLimitPitch = aHighOrderPairObject->LowLimitPitch();
Standard_Real aUpperLimitPitch = aHighOrderPairObject->UpperLimitPitch();
Standard_Real aLowerLimitRoll = aHighOrderPairObject->LowLimitRoll();
- Standard_Real aUpperLimitRoll = aHighOrderPairObject->UpperLimitRoll();
- Handle(Geom_TrimmedCurve) aRangeOnCurve = aHighOrderPairObject->TrimmedCurve();
- Handle(StepGeom_HArray1OfTrimmingSelect) aSTS1 =
- new StepGeom_HArray1OfTrimmingSelect(1, 2);
- StepGeom_TrimmingSelect tSel;
- GeomToStep_MakeCartesianPoint aMP1(aRangeOnCurve->StartPoint());
- tSel.SetValue(aMP1.Value());
- aSTS1->SetValue(1, tSel);
- tSel.SetParameterValue(aRangeOnCurve->FirstParameter());
- aSTS1->SetValue(2, tSel);
-
- Handle(StepGeom_HArray1OfTrimmingSelect) aSTS2 =
- new StepGeom_HArray1OfTrimmingSelect(1, 2);
- GeomToStep_MakeCartesianPoint aMP2(aRangeOnCurve->EndPoint());
- tSel.SetValue(aMP2.Value());
- aSTS2->SetValue(1, tSel);
- tSel.SetParameterValue(aRangeOnCurve->LastParameter());
- aSTS2->SetValue(2, tSel);
-
- Handle(TCollection_HAsciiString) empty =
- new TCollection_HAsciiString("");
- Handle(StepGeom_TrimmedCurve) aRangeOnPairCurve = new StepGeom_TrimmedCurve;
- aRangeOnPairCurve->Init(empty, aPairCurve, aSTS1, aSTS2, Standard_True, StepGeom_tpParameter);
+ Standard_Real aUpperLimitRoll = aHighOrderPairObject->UpperLimitRoll();
+ Handle(StepGeom_TrimmedCurve) aRangeOnPairCurve = Handle(StepGeom_TrimmedCurve)::DownCast(aPairCurve);
theKinematicPair = new StepKinematics_PointOnPlanarCurvePairWithRange;
Handle(StepKinematics_PointOnPlanarCurvePairWithRange) aPointOnPlanarCurvePairWithRange = Handle(StepKinematics_PointOnPlanarCurvePairWithRange)::DownCast(theKinematicPair);
aPointOnPlanarCurvePairWithRange->Init(aPairName, aPairName, hasDescription,
- aDescription, theTransformItem1, theTransformItem2, theJoint, aPairCurve, anOrientation, aRangeOnPairCurve,Standard_True,aLowerLimitYaw, Standard_True,aUpperLimitYaw, Standard_True,
- aLowerLimitPitch, Standard_True, aUpperLimitPitch, Standard_True,aLowerLimitRoll, Standard_True, aUpperLimitRoll);
+ aDescription, theTransformItem1, theTransformItem2, theJoint, aPairCurve, anOrientation, aRangeOnPairCurve, Standard_True, aLowerLimitYaw, Standard_True, aUpperLimitYaw, Standard_True,
+ aLowerLimitPitch, Standard_True, aUpperLimitPitch, Standard_True, aLowerLimitRoll, Standard_True, aUpperLimitRoll);
}
else
{
case(XCAFKinematics_PairType_LinearFlexibleAndPlanarCurve):
{
theKinematicPair = new StepKinematics_LinearFlexibleAndPlanarCurvePair;
- GeomToStep_MakeCurve aMaker(aHighOrderPairObject->FirstCurve());
+ GeomToStep_MakeCurve aMaker(aHighOrderPairObject->Curve());
Handle(StepGeom_Curve) aPairCurve = aMaker.Value();
Standard_Boolean anOrientation = aHighOrderPairObject->Orientation();
Handle(StepKinematics_LinearFlexibleAndPlanarCurvePair) aLinearFlexibleAndPlanarCurvePair = Handle(StepKinematics_LinearFlexibleAndPlanarCurvePair)::DownCast(theKinematicPair);
break;
}
Handle(StepKinematics_KinematicPair) aAppliesToPair =
- Handle(StepKinematics_KinematicPair)::DownCast(thePairReprRelationship->RepresentationRelationshipWithTransformation()->TransformationOperator().KinematicPair());
+ thePairReprRelationship->RepresentationRelationshipWithTransformation()->TransformationOperator().KinematicPair();
thePairValue->SetAppliesToPair(aAppliesToPair);
thePairValue->SetName(aAppliesToPair->Name());
return Standard_True;
// get working data
const Handle(Interface_InterfaceModel)& Model = theWS->Model();
- const Handle(XSControl_TransferWriter)& TW = theWS->TransferWriter();
- const Handle(Transfer_FinderProcess)& FP = TW->FinderProcess();
const Handle(Interface_HGraph) aHGraph = theWS->HGraph();
if (aHGraph.IsNull())
Handle(XCAFKinematics_PairObject) aPairObject = aKPairAttr->GetObject();
Handle(StepKinematics_KinematicLinkRepresentation) aLinkRepr1;
Handle(StepKinematics_KinematicLinkRepresentation) aLinkRepr2;
- if (!createKinematicJoint(FP, aKTool, aGraph, aJointL, aPairObject, aMapOfLinks, aLinkRepr1, aLinkRepr2, aJoint))
+ if (!createKinematicJoint(aKTool, aJointL, aPairObject, aMapOfLinks, aLinkRepr1, aLinkRepr2, aJoint))
continue;
if (!createKinematicPair(aPairObject,aJoint,aKinematicPair, aLinkRepr1, aLinkRepr2))
continue;
Handle(StepKinematics_ActuatedKinPairAndOrderKinPair) aComplexPair = GetCasted(StepKinematics_ActuatedKinPairAndOrderKinPair, Value());
if (aComplexPair.IsNull())
return GetCasted(StepKinematics_KinematicPair, Value());
- return GetCasted(StepKinematics_KinematicPair, aComplexPair->GetOrderKinematicPair());
+ return aComplexPair->GetOrderKinematicPair();
}
}
//=============================================================================
-// Creation d' un AxisPlacement de Geom2d a partir d' un SuParameters de Step
+// Creation of an AxisPlacement from a Kinematic SuParameters for Step
//=============================================================================
Handle(Geom_Axis2Placement) StepToGeom::MakeAxis2Placement(const Handle(StepKinematics_SuParameters)& SP)
}
//=============================================================================
-// Creation d' un YptRotation de Kinematic a partir d' un SpatialRotation de Step
+// Creation of a YptRotation from a Kinematic SpatialRotation for Step
//=============================================================================
Handle(TColStd_HArray1OfReal) StepToGeom::MakeYprRotation(const StepKinematics_SpatialRotation& SR, const Handle(StepRepr_GlobalUnitAssignedContext)& theCntxt)
Handle(TColStd_HArray1OfReal) anYPRRotation;
if (!SR.YprRotation().IsNull() &&
SR.YprRotation()->Length() == 3)
- {
- anYPRRotation = SR.YprRotation();
- return anYPRRotation;
- }
+ return SR.YprRotation();
if (SR.RotationAboutDirection().IsNull() ||
SR.RotationAboutDirection()->DirectionOfAxis()->DirectionRatios()->Length() != 3 ||
anYPRRotation->SetValue(1, 0.);
anYPRRotation->SetValue(2, 0.);
anYPRRotation->SetValue(3, 0.);
- if (dx != 0.)
+ if (Abs(dx) >= Precision::Confusion())
if (dx > 0.)
anYPRRotation->SetValue(3, aYaw);
else
if (theObject->Type() == XCAFKinematics_PairType_PointOnSurface && !anObject->Surface().IsNull())
{
TopoDS_Face aFace;
- if (anObject->HasLimits())
- aBuilder.MakeFace(aFace, anObject->TrimmedSurface(), Precision::Confusion());
- else
- aBuilder.MakeFace(aFace, anObject->Surface(), Precision::Confusion());
+ aBuilder.MakeFace(aFace, anObject->Surface(), Precision::Confusion());
TNaming_Builder aTNBuild(Label().FindChild(ChildLab_FirstGeomParam));
aTNBuild.Generated(aFace);
}
aTNBuild2.Generated(aFace2);
}
}
- if (theObject->Type() == XCAFKinematics_PairType_PointOnPlanarCurve && !anObject->Curve().IsNull())
+ if ((theObject->Type() == XCAFKinematics_PairType_PointOnPlanarCurve ||
+ theObject->Type() == XCAFKinematics_PairType_LinearFlexibleAndPlanarCurve) && !anObject->Curve().IsNull())
{
TopoDS_Edge anEdge;
- if (anObject->HasLimits())
- aBuilder.MakeEdge(anEdge, anObject->TrimmedCurve(), Precision::Confusion());
- else
- aBuilder.MakeEdge(anEdge, anObject->Curve(), Precision::Confusion());
+ aBuilder.MakeEdge(anEdge, anObject->Curve(), Precision::Confusion());
TNaming_Builder aTNBuild(Label().FindChild(ChildLab_FirstGeomParam));
aTNBuild.Generated(anEdge);
}
- if (anObject->Type() >= XCAFKinematics_PairType_SlidingCurve &&
- anObject->Type() <= XCAFKinematics_PairType_LinearFlexibleAndPlanarCurve)
+ if (anObject->Type() == XCAFKinematics_PairType_SlidingCurve ||
+ anObject->Type() == XCAFKinematics_PairType_RollingCurve)
{
TopoDS_Edge anEdge1, anEdge2;
if (!anObject->FirstCurve().IsNull()) {
aDefObject->SetSecondSurface(BRep_Tool::Surface(aFace));
}
}
- if (anObject->Type() == XCAFKinematics_PairType_PointOnPlanarCurve)
+ if (anObject->Type() == XCAFKinematics_PairType_PointOnPlanarCurve ||
+ anObject->Type() == XCAFKinematics_PairType_LinearFlexibleAndPlanarCurve)
{
if (Label().FindChild(ChildLab_FirstGeomParam).FindAttribute(TNaming_NamedShape::GetID(), aNS))
{
aDefObject->SetSecondCurve(BRep_Tool::Curve(anEdge, aFirst, aLast));
}
}
- if (anObject->Type() == XCAFKinematics_PairType_LinearFlexibleAndPlanarCurve)
- {
- if (Label().FindChild(ChildLab_FirstGeomParam).FindAttribute(TNaming_NamedShape::GetID(), aNS))
- {
- TopoDS_Edge anEdge = TopoDS::Edge(TNaming_Tool::GetShape(aNS));
- Standard_Real aFirst, aLast;
- aDefObject->SetFirstCurve(BRep_Tool::Curve(anEdge, aFirst, aLast));
- }
- }
}
return anObject;
//! This parameter is an additional attribute for kinematic pair attribute,
//! which characterizes the pair for one of the mechanism states.
//! It is prohibited to store inconsistent data:
-//! - to store this attribute without kinematic value attribute
-//! - to store this attribute not of the same type as the type of the pair
+//! - to store this attribute not of the same type as the type of linked the pair
class XCAFDoc_KinematicPairValue : public TDF_Attribute
{
(!aLinkName.IsNull() && !aLinkName->Get().IsDifferent("Link " + theLink.Tag())))
TDataStd_Name::Set(theLink, "Base");
TDataStd_Integer::Set(theLink, 1);
+
+ return Standard_True;
}
//=======================================================================
//=======================================================================
void XCAFKinematics_HighOrderPairObject::SetCurve(const Handle(Geom_Curve)& theCurve)
{
- if (Type() == XCAFKinematics_PairType_PointOnPlanarCurve)
+ if (Type() == XCAFKinematics_PairType_PointOnPlanarCurve || Type() == XCAFKinematics_PairType_LinearFlexibleAndPlanarCurve)
myGeom.ChangeFirst() = theCurve;
}
//=======================================================================
Handle(Geom_Curve) XCAFKinematics_HighOrderPairObject::Curve() const
{
- if (Type() == XCAFKinematics_PairType_PointOnPlanarCurve && !myGeom.First().IsNull())
- {
- if (myGeom.First()->IsKind(STANDARD_TYPE(Geom_TrimmedCurve)))
- {
- Handle(Geom_TrimmedCurve) aTrimCurve = Handle(Geom_TrimmedCurve)::DownCast(myGeom.First());
- return aTrimCurve->BasisCurve();
- }
- else
- return Handle(Geom_Curve)::DownCast(myGeom.First());
- }
+ if (Type() == XCAFKinematics_PairType_PointOnPlanarCurve || Type() == XCAFKinematics_PairType_LinearFlexibleAndPlanarCurve)
+ return Handle(Geom_Curve)::DownCast(myGeom.First());
return NULL;
}
//=======================================================================
void XCAFKinematics_HighOrderPairObject::SetFirstCurve(const Handle(Geom_Curve)& theCurve)
{
- if (Type() >= XCAFKinematics_PairType_SlidingCurve && Type() <= XCAFKinematics_PairType_LinearFlexibleAndPlanarCurve)
+ if (Type() == XCAFKinematics_PairType_SlidingCurve || Type() == XCAFKinematics_PairType_RollingCurve)
myGeom.ChangeFirst() = theCurve;
}
//=======================================================================
Handle(Geom_Curve) XCAFKinematics_HighOrderPairObject::FirstCurve() const
{
- if (Type() >= XCAFKinematics_PairType_SlidingCurve && Type() <= XCAFKinematics_PairType_LinearFlexibleAndPlanarCurve)
+ if (Type() == XCAFKinematics_PairType_SlidingCurve || Type() == XCAFKinematics_PairType_RollingCurve)
return Handle(Geom_Curve)::DownCast(myGeom.First());
return NULL;
}
return NULL;
}
-//=======================================================================
-//function : SetTrimmedCurve
-//purpose :
-//=======================================================================
-void XCAFKinematics_HighOrderPairObject::SetTrimmedCurve(const Handle(Geom_TrimmedCurve)& aTrimCurve)
-{
- if (Type() != XCAFKinematics_PairType_PointOnPlanarCurve && !HasLimits())
- return;
- myGeom.ChangeFirst() = aTrimCurve;
-}
-
-//=======================================================================
-//function : TrimmedCurve
-//purpose :
-//=======================================================================
-Handle(Geom_TrimmedCurve) XCAFKinematics_HighOrderPairObject::TrimmedCurve() const
-{
- if (Type() != XCAFKinematics_PairType_PointOnPlanarCurve)
- return NULL;
- return Handle(Geom_TrimmedCurve)::DownCast(myGeom.First());
-}
-
//=======================================================================
//function : SetSurface
//purpose :
Handle(Geom_Surface) XCAFKinematics_HighOrderPairObject::Surface() const
{
if (Type() == XCAFKinematics_PairType_PointOnSurface)
- if (!myGeom.First().IsNull() && myGeom.First()->IsKind(STANDARD_TYPE(Geom_RectangularTrimmedSurface)))
- {
- Handle(Geom_RectangularTrimmedSurface) aTrimSurface = Handle(Geom_RectangularTrimmedSurface)::DownCast(myGeom.First());
- return aTrimSurface->BasisSurface();
- }
- else
- return Handle(Geom_Surface)::DownCast(myGeom.First());
+ return Handle(Geom_Surface)::DownCast(myGeom.First());
return NULL;
}
return Handle(Geom_Surface)::DownCast(myGeom.Last());
return NULL;
}
-
-//=======================================================================
-//function : SetTrimmedSurface
-//purpose :
-//=======================================================================
-void XCAFKinematics_HighOrderPairObject::SetTrimmedSurface(const Handle(Geom_RectangularTrimmedSurface)& aTrimSurface)
-{
- if (Type() != XCAFKinematics_PairType_PointOnSurface && !HasLimits())
- return;
- myGeom.ChangeFirst() = aTrimSurface;
-}
-
-//=======================================================================
-//function : TrimmedSurface
-//purpose :
-//=======================================================================
-Handle(Geom_RectangularTrimmedSurface) XCAFKinematics_HighOrderPairObject::TrimmedSurface() const
-{
- if (Type() != XCAFKinematics_PairType_PointOnSurface)
- return NULL;
- return Handle(Geom_RectangularTrimmedSurface)::DownCast(myGeom.First());
-}
//! \return limit
Standard_EXPORT Standard_Real UpperLimitPitch();
- //! Sets curve attribute (only for PointOnPlanarCurve)
+ //! Sets curve attribute (only for PointOnPlanarCurve and LinearAndFlexibleCurve)
//! \param[in] theCurve curve
Standard_EXPORT void SetCurve(const Handle(Geom_Curve)& theCurve);
- //! Gets curve attribute (only for PointOnPlanarCurve)
+ //! Gets curve attribute (only for PointOnPlanarCurve and LinearAndFlexibleCurve)
//! \return curve
Standard_EXPORT Handle(Geom_Curve) Curve() const;
- //! Sets curve attribute (only for SlidingCurve, RollingCurve LinearAndFlexibleCurve)
+ //! Sets curve attribute (only for SlidingCurve and RollingCurve)
//! \param[in] theCurve curve
Standard_EXPORT void SetFirstCurve(const Handle(Geom_Curve)& theCurve);
- //! Gets curve attribute (only for SlidingCurve, RollingCurve LinearAndFlexibleCurve)
+ //! Gets curve attribute (only for SlidingCurve and RollingCurve)
//! \return curve
Standard_EXPORT Handle(Geom_Curve) FirstCurve() const;
//! \return curve
Standard_EXPORT Handle(Geom_Curve) SecondCurve() const;
- //! Sets trimmed curve attribute (only for PointOnCurve)
- //! \param[in] aTrimCurve trimmed curve
- Standard_EXPORT void SetTrimmedCurve(const Handle(Geom_TrimmedCurve)& aTrimCurve);
-
- //! Gets trimmed curve attribute (only for PointOnCurve)
- //! \return trimmed curve
- Standard_EXPORT Handle(Geom_TrimmedCurve) TrimmedCurve() const;
-
//! Sets surface attribute (only for PointOnSurface)
//! \param[in] theSurface surface
Standard_EXPORT void SetSurface(const Handle(Geom_Surface)& theSurface);
//! \return surface
Standard_EXPORT Handle(Geom_Surface) SecondSurface() const;
- //! Sets trimmed surface attribute (only for PointOnSurface)
- //! \param[in] aTrimSurface trimmered surface
- Standard_EXPORT void SetTrimmedSurface(const Handle(Geom_RectangularTrimmedSurface)& aTrimSurface);
-
- //! Gets trimmed surface attribute (only for PointOnSurface)
- //! \return trimmed surface
- Standard_EXPORT Handle(Geom_RectangularTrimmedSurface) TrimmedSurface() const;
-
DEFINE_STANDARD_RTTIEXT(XCAFKinematics_HighOrderPairObject, XCAFKinematics_PairObject)
private:
void SetSkewAngle(const Standard_Real theAngle)
{
- if (Type() == XCAFKinematics_PairType_Universal || XCAFKinematics_PairType_Homokinetic)
+ if (Type() == XCAFKinematics_PairType_Universal || Type() == XCAFKinematics_PairType_Homokinetic)
mySkewAngle = theAngle;
}
Standard_Real SkewAngle() const
{
- if (Type() == XCAFKinematics_PairType_Universal || XCAFKinematics_PairType_Homokinetic)
+ if (Type() == XCAFKinematics_PairType_Universal || Type() == XCAFKinematics_PairType_Homokinetic)
return mySkewAngle;
else return 0;
}
//! - XCAFKinematics_PairType_Screw
//! - XCAFKinematics_PairType_RackAndPinion
//! - XCAFKinematics_PairType_Gear
+//! - XCAFKinematics_PairType_LinearFlexibleAndPinion
class XCAFKinematics_LowOrderPairObjectWithCoupling : public XCAFKinematics_PairObject
{
di << "Invalid geometric argument\n";
return 1;
}
- if (anObject->Type() == XCAFKinematics_PairType_PointOnPlanarCurve)
+ if (anObject->Type() == XCAFKinematics_PairType_PointOnPlanarCurve ||
+ anObject->Type() == XCAFKinematics_PairType_LinearFlexibleAndPlanarCurve)
anObject->SetCurve(aCurve);
- else if (anObject->Type() == XCAFKinematics_PairType_LinearFlexibleAndPlanarCurve)
- anObject->SetFirstCurve(aCurve);
else {
switch (aParamNb) {
case 1: anObject->SetFirstCurve(aCurve);
// Surface
Handle(Geom_Surface) aSurface;
if (anObject->Type() == XCAFKinematics_PairType_PointOnSurface)
- if (!anObject->HasLimits())
- aSurface = anObject->Surface();
- else
- aSurface = anObject->TrimmedSurface();
+ aSurface = anObject->Surface();
else {
switch (aTrsfNb) {
case 1: aSurface = anObject->FirstSurface();
else {
// Curve
Handle(Geom_Curve) aCurve;
- if (anObject->Type() == XCAFKinematics_PairType_PointOnPlanarCurve)
- if (!anObject->HasLimits())
- aCurve = anObject->Curve();
- else
- aCurve = anObject->TrimmedCurve();
- else if(anObject->Type() == XCAFKinematics_PairType_LinearFlexibleAndPlanarCurve)
- aCurve = anObject->FirstCurve();
+ if (anObject->Type() == XCAFKinematics_PairType_PointOnPlanarCurve ||
+ anObject->Type() == XCAFKinematics_PairType_LinearFlexibleAndPlanarCurve)
+ aCurve = anObject->Curve();
else {
switch (aTrsfNb) {
case 1: aCurve = anObject->FirstCurve();
di.Add("XSetPairParams", "XSetPairParams Doc Joint Value1 Value2..."
"\tScrew - Pitch\n"
"\tRackAndPinion - PinionRadius\n"
- "\tGear -FirstLinkRadius SecondLinkRadius Bevel HelicalAngle GearRatio \n"
- "\tLinear - SkewAngle \n"
+ "\tGear - FirstLinkRadius SecondLinkRadius Bevel HelicalAngle GearRatio\n"
+ "\tLinear - PinionRadius\n"
__FILE__, setParameters, g);
di.Add("XGetPairParams", "XGetPairParams Doc Joint",