Changeset 114 for cpp/frams


Ignore:
Timestamp:
01/26/14 05:53:23 (11 years ago)
Author:
sz
Message:

improved/bug fixed: delta joint mode (in f0 genotypes) is now triggered by any of dx/dy/dz fields, not just dx

Location:
cpp/frams/model
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/model/model.cpp

    r109 r114  
    594594                {
    595595                addJoint(j);
    596                 if (j->d.x < (JOINT_DELTA_MARKER-1.0))
     596                if ((j->d.x != JOINT_DELTA_MARKER) || (j->d.y != JOINT_DELTA_MARKER) || (j->d.z != JOINT_DELTA_MARKER))
     597                        {
    597598                        j->useDelta(1);
     599                        j->resetDeltaMarkers();
     600                        }
    598601                j->attachToParts(j->p1_refno,j->p2_refno);
    599602                if (srcrange) j->setMapping(*srcrange);
     
    914917                        j->part2->mass+=1.0;
    915918                        }
    916                 if ((j->usedelta)&&(j->d.x < (JOINT_DELTA_MARKER-1.0)))
     919                if ((j->usedelta)&&((j->d.x!=JOINT_DELTA_MARKER)||(j->d.y!=JOINT_DELTA_MARKER)||(j->d.z!=JOINT_DELTA_MARKER)))
    917920                        { // delta positioning -> calc. orient.
    918921                        if (j->part2->flags & LINKFLAG)
     
    923926                                         i,(const char*)geno.getName());
    924927                                }
     928                        j->resetDeltaMarkers();
    925929                        j->o=j->rot;
    926930                        j->part1->o.transform(j->part2->o,j->o);
  • cpp/frams/model/modelparts.cpp

    r109 r114  
    696696defassign();
    697697d.x=JOINT_DELTA_MARKER;
     698d.y=JOINT_DELTA_MARKER;
     699d.z=JOINT_DELTA_MARKER;
    698700part1=0; part2=0;
    699701flags=0;
     
    736738void Joint::resetDelta()
    737739{
    738 d=Pt3D(JOINT_DELTA_MARKER,0,0);
    739 }
    740 
    741 void Joint::useDelta(int false_or_true)
    742 {
    743 usedelta=false_or_true;
    744 }
    745 
    746 int Joint::isDelta()
     740d=Pt3D(JOINT_DELTA_MARKER,JOINT_DELTA_MARKER,JOINT_DELTA_MARKER);
     741}
     742
     743void Joint::resetDeltaMarkers()
     744{
     745if (d.x==JOINT_DELTA_MARKER) d.x=0;
     746if (d.y==JOINT_DELTA_MARKER) d.y=0;
     747if (d.z==JOINT_DELTA_MARKER) d.z=0;
     748}
     749
     750void Joint::useDelta(bool use)
     751{
     752usedelta=use;
     753}
     754
     755bool Joint::isDelta()
    747756{
    748757return usedelta;
  • cpp/frams/model/modelparts.h

    r109 r114  
    116116        {d=Pt3D(_d,0,0);}
    117117void defassign();
     118void resetDeltaMarkers();
    118119public:
    119120// base properties:
     
    146147    delta value is not changed.
    147148 */
    148 void useDelta(int false_or_true);
    149 
    150 /** @return 1 if delta option is in effect.
     149void useDelta(bool use);
     150
     151/** @return true if delta option is in effect.
    151152    @see useDelta(), resetDelta(), useDelta()
    152153*/
    153 int isDelta();
     154bool isDelta();
    154155
    155156/// ParamInterface object is preferred way to get/set other properties.
     
    164165/** flag: generated f0 should include delta data.
    165166    set by 'singlestep' if j: attributes use delta option */
    166 int usedelta;
     167bool usedelta;
    167168Pt3D vcolor;
    168169
Note: See TracChangeset for help on using the changeset viewer.