![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2008 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtDiGuyOsgGraphicsLink.h,v $ $Revision: 1.13 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #ifndef DtDiGuyOsgGraphicsLink_H_ 00014 #define DtDiGuyOsgGraphicsLink_H_ 00015 00016 #include <vrvDiGuy/vrvDiGuy.h> 00017 #include <diguyGraphicsLink.h> 00018 #include <osg/ref_ptr> 00019 #include <osg/MatrixTransform> 00020 #include <osg/Switch> 00021 00022 namespace makVrv 00023 { 00024 class DtSceneObject; 00025 class DtDe; 00026 00029 class DT_DLL_VRVDIGUY DtDiGuyOsgGraphicsLink : public diguyGraphicsLink 00030 { 00031 public: 00032 00033 static diguyGraphicsLink* create(void* internal_data); 00034 00035 //DTOR 00036 virtual ~DtDiGuyOsgGraphicsLink(); 00037 00038 virtual void build(); 00039 virtual void unbuild(); 00040 virtual void attach_to_scene(); 00041 virtual void detach_from_scene(); 00042 virtual void attach_to_link(diguyGraphicsLink* link); 00043 virtual void detach_from_link(); 00044 virtual void update(); 00045 00047 void useExternalNode(osg::MatrixTransform*); 00048 void setExternalObject(DtSceneObject* object); 00049 00050 void useInternalNodes(); 00051 00053 osg::MatrixTransform* get_dof_node(); 00054 00055 //Get the model root, this will be NULL if the link is not a base link. 00056 osg::Group* modelRoot(); 00057 00058 void setVisible(bool visible); 00059 00060 protected: 00061 00062 //CTOR 00063 DtDiGuyOsgGraphicsLink(DtDe& de,void* internal_data); 00064 00065 void createModelRoot(); 00066 void releaseModelRoot(); 00067 protected: 00068 00069 const std::string myNameRoot; 00070 DtDe& myDe; 00071 osg::ref_ptr<osg::MatrixTransform> myLinkOffsetNode; 00072 osg::ref_ptr<osg::MatrixTransform> myLinkOrientationNode; 00073 osg::ref_ptr<osg::MatrixTransform> myObjectTransformNode; 00074 osg::ref_ptr<osg::MatrixTransform> myModelRoot; 00075 00076 DtSceneObject* myObject; 00077 bool myInSceneFlag; 00078 bool myIsVisibleFlag; 00079 }; 00080 } 00081 00082 #endif 00083