@@ -2147,7 +2147,7 @@ bool FmTriad::isTranslatable(const FmJointBase* jointToIgnore) const
21472147/*!
21482148 This method is used in the Origin tab and the Align CS commands
21492149 to find out if it is possible to rotate the triad.
2150- If it is either the dependent triad in a point joint,
2150+ If it is either the dependent triad in a point joint or line joint ,
21512151 or an independent joint triad and its movability is connected to an
21522152 "owning" joint, then it is not allowed to rotate it.
21532153 If it is an independent triad of a prismatic or cylindric joint,
@@ -2157,15 +2157,22 @@ bool FmTriad::isTranslatable(const FmJointBase* jointToIgnore) const
21572157char FmTriad ::isRotatable (const FmJointBase * jointToIgnore ) const
21582158{
21592159 // Check if this is the dependent triad in a point joint
2160- if (FmJointBase * joint = this -> getJointWhereSlave (); joint )
2161- if (joint -> isOfType (FmSMJointBase ::getClassTypeID ()))
2162- if (joint != jointToIgnore ) return false;
2160+ // or a prismatic or cylindric joint
2161+ std ::vector < FmJointBase * > joints ;
2162+ this -> getReferringObjs (joints ,"itsSlaveTriad" );
2163+ for (FmJointBase * joint : joints )
2164+ if (joint -> isOfType (FmSMJointBase ::getClassTypeID ()) &&
2165+ joint != jointToIgnore && !joint -> isGlobalSpringElement ())
2166+ return false;
2167+ else if (joint -> isOfType (FmMMJointBase ::getClassTypeID ()) &&
2168+ !joint -> isOfType (FmCamJoint ::getClassTypeID ()))
2169+ return false;
21632170
21642171 // Check if this is an independent triad of a point joint and
21652172 // is coupled to move along with any of the joints it is a member of
2166- std ::vector < FmSMJointBase * > joints ;
2167- this -> getReferringObjs (joints ,"itsMasterTriad" );
2168- for (FmSMJointBase * joint : joints )
2173+ std ::vector < FmSMJointBase * > joints1 ;
2174+ this -> getReferringObjs (joints1 ,"itsMasterTriad" );
2175+ for (FmSMJointBase * joint : joints1 )
21692176 if (joint -> isMasterMovedAlong ())
21702177 if (joint != jointToIgnore ) return false;
21712178
@@ -2178,12 +2185,12 @@ char FmTriad::isRotatable(const FmJointBase* jointToIgnore) const
21782185
21792186 // Check that the object defining the reference coordinate system of the
21802187 // orientation angles is one of the prismatic/cylindric joints using this
2181- std ::vector < FmMMJointBase * > jnts ;
2188+ std ::vector < FmMMJointBase * > joints2 ;
21822189 std ::vector < Fm1DMaster * > lines ;
21832190 this -> getReferringObjs (lines ,"myTriads" );
21842191 for (Fm1DMaster * line : lines )
2185- line -> getReferringObjs (jnts ,"myMaster" );
2186- for (FmMMJointBase * joint : jnts )
2192+ line -> getReferringObjs (joints2 ,"myMaster" );
2193+ for (FmMMJointBase * joint : joints2 )
21872194 if (myRotRef .getPointer () == joint )
21882195 return 3 ; // can rotate about the local Z-axis of the owning joint
21892196
0 commit comments