Show
Ignore:
Timestamp:
05/05/08 07:12:19 (5 months ago)
Author:
vossg
Message:

changed: interface cleanup, removed ptr typedefs, nullfc

these will be needed for the 1.x compat stuff

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/Source/Contrib/Manipulators/OSGManipulator.cpp

    r1195 r1198  
    9595Manipulator::Manipulator(void) : 
    9696    Inherited(), 
    97     _activeParent( NullFC ), 
     97    _activeParent( NULL ), 
    9898    _externalUpdateHandler( NULL ) 
    9999{ 
     
    139139    else if ( (whichField & ParentsFieldMask) == ParentsFieldMask ) 
    140140    { 
    141         NodePtr   parent; 
     141        Node *parent; 
    142142 
    143143        if ( !getParents().empty() ) 
    144144        { 
    145145            //std::cout << "parent size= " << parents.getSize() << std::endl; 
    146             parent = dynamic_cast<NodePtr>(getParents()[0]); // Dangerous! multiple parents? 
     146            parent = dynamic_cast<Node *>(getParents()[0]); // Dangerous! multiple parents? 
    147147        } 
    148148        else 
    149149        { 
    150             parent = NullFC
     150            parent = NULL
    151151        } 
    152152 
     
    156156        if ( parent != _activeParent ) 
    157157        { 
    158             if ( NullFC != parent ) 
     158            if ( NULL != parent ) 
    159159            { 
    160160                // remove old childs from a loaded osb file. 
     
    166166            } 
    167167 
    168             if ( _activeParent != NullFC
     168            if ( _activeParent != NULL
    169169            { 
    170170                subHandleGeo(_activeParent); 
     
    176176} 
    177177 
    178 void Manipulator::addHandleGeo(NodePtr n) 
     178void Manipulator::addHandleGeo(Node *n) 
    179179{ 
    180180    n->addChild(getTransXNode()); 
     
    184184} 
    185185 
    186 void Manipulator::subHandleGeo(NodePtr n) 
     186void Manipulator::subHandleGeo(Node *n) 
    187187{ 
    188188    n->subChild(getTransXNode()); 
     
    194194void Manipulator::reverseTransform() 
    195195{ 
    196     if ( getTarget() != NullFC
    197     { 
    198         TransformPtr t = dynamic_cast<TransformPtr>(getTarget()->getCore()); 
    199         Matrix          m,n,o; 
     196    if ( getTarget() != NULL
     197    { 
     198        Transform *t = dynamic_cast<Transform *>(getTarget()->getCore()); 
     199        Matrix     m,n,o; 
    200200 
    201201        Vec3f      translation; 
     
    251251    setMaterialZ(pMat); 
    252252 
    253     SimpleMaterialPtr  simpleMat; 
    254     GeometryPtr        geo; 
     253    SimpleMaterial *simpleMat; 
     254    Geometry       *geo; 
    255255 
    256256    setExternalUpdateHandler(NULL); 
     
    282282    _transHandleXC->setRotation   (Quaternion(Vec3f(0, 0, 1), osgDegree2Rad(-90))); 
    283283 
    284     simpleMat = dynamic_cast<SimpleMaterialPtr>(getMaterialX()); 
     284    simpleMat = dynamic_cast<SimpleMaterial *>(getMaterialX()); 
    285285 
    286286    simpleMat->setDiffuse(Color3f(1, 0, 0)); 
    287287    simpleMat->setLit    (true            ); 
    288288 
    289     geo = dynamic_cast<GeometryPtr>(getHandleXNode()->getCore()); 
     289    geo = dynamic_cast<Geometry *>(getHandleXNode()->getCore()); 
    290290    geo->setMaterial(simpleMat); 
    291291 
     
    307307//    _transHandleYC->setRotation   ( Quaternion(Vec3f(0, 0, 1), osgDegree2Rad(-90))); 
    308308 
    309     simpleMat = dynamic_cast<SimpleMaterialPtr>(getMaterialY()); 
     309    simpleMat = dynamic_cast<SimpleMaterial *>(getMaterialY()); 
    310310    simpleMat->setDiffuse(Color3f(0, 1, 0)); 
    311311    simpleMat->setLit    (true            ); 
    312312 
    313     geo = dynamic_cast<GeometryPtr>(getHandleYNode()->getCore()); 
     313    geo = dynamic_cast<Geometry *>(getHandleYNode()->getCore()); 
    314314    geo->setMaterial(simpleMat); 
    315315 
     
    331331    _transHandleZC->setRotation   (Quaternion(Vec3f(1, 0, 0), osgDegree2Rad(90))); 
    332332 
    333     simpleMat = dynamic_cast<SimpleMaterialPtr>(getMaterialZ()); 
     333    simpleMat = dynamic_cast<SimpleMaterial *>(getMaterialZ()); 
    334334    simpleMat->setDiffuse(Color3f(0, 0, 1)); 
    335335    simpleMat->setLit    (true            ); 
    336336 
    337     geo = dynamic_cast<GeometryPtr>(getHandleZNode()->getCore()); 
     337    geo = dynamic_cast<Geometry *>(getHandleZNode()->getCore()); 
    338338    geo->setMaterial(simpleMat); 
    339339 
     
    349349    Inherited::resolveLinks(); 
    350350 
    351     _activeParent  = NullFC
    352  
    353     _transHandleXC = NullFC
    354     _transHandleYC = NullFC
    355     _transHandleZC = NullFC
    356 } 
    357  
    358 Pnt2f Manipulator::calcScreenProjection(const Pnt3f       &p, 
    359                                         const ViewportPtr &port) 
    360 { 
    361     CameraPtr  cam; 
    362     Matrix     proj, projtrans, view; 
    363     Pnt3f      pnt; 
    364  
    365     if( port != NullFC
     351    _activeParent  = NULL
     352 
     353    _transHandleXC = NULL
     354    _transHandleYC = NULL
     355    _transHandleZC = NULL
     356} 
     357 
     358Pnt2f Manipulator::calcScreenProjection(const Pnt3f    &       p, 
     359                                              Viewport * const port) 
     360{ 
     361    Camera  *cam; 
     362    Matrix   proj, projtrans, view; 
     363    Pnt3f    pnt; 
     364 
     365    if( port != NULL
    366366    { 
    367367        cam = port->getCamera(); 
     
    387387    { 
    388388        SWARNING << "calcScreenProjection(const Pnt3f&, " 
    389                     "const ViewportPtr& port=" 
     389                    "Viewport * const port=" 
    390390                 << port << ")\n"; 
    391391        return Pnt2f(0.0f, 0.0f); 
     
    405405 
    406406    // get the beacon's core (must be ComponentTransform) and it's center 
    407     if( getTarget() != NullFC
     407    if( getTarget() != NULL
    408408    { 
    409409        // get transformation of beacon 
    410         TransformPtr t = dynamic_cast<TransformPtr>(getTarget()->getCore()); 
    411  
    412         if( t != NullFC
     410        Transform *t = dynamic_cast<Transform *>(getTarget()->getCore()); 
     411 
     412        if( t != NULL
    413413        { 
    414414            UInt16     coord(0);          // active coordinate: X=0, Y=1, Z=2