![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2008 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 00008 00010 00011 #ifndef DtKynapseLinesModel_H_ 00012 #define DtKynapseLinesModel_H_ 00013 00014 #include <vrfGuiCore/vrfGuiCore.h> 00015 #include <vrvCore/DtDe.h> 00016 #include <vrvCore/DtUniqueID.h> 00017 #include <osg/Geode> 00018 #include "simTerrainDrawer/debugDrawerSharedMemoryManager.h" 00019 00020 #include <vrvOsg/DtOsgRenderer.h> 00021 00022 #include <osg/Geometry> 00023 #include <osg/Geode> 00024 #include <osg/LineWidth> 00025 #include <osg/PositionAttitudeTransform> 00026 #include <osg/ShapeDrawable> 00027 #include <osg/Material> 00028 #include <vrvOsg/DtOsgNodeTraversalFlags.h> 00029 00030 #include <vrvOsg/DtOsgRenderer.h> 00031 #include <vrvUtil/DtCoordinateSystem.h> 00032 #include <vrvCore/DtDeSharedState.h> 00033 00034 #include <string> 00035 #include <vector> 00036 #include <math.h> 00037 00038 namespace makVrf 00039 { 00044 class DT_DLL_VRFGUICORE DtKynapseLinesModel 00045 { 00046 public: 00048 DtKynapseLinesModel(makVrv::DtDe& de, makVrv::DtUniqueID id); 00049 00051 virtual ~DtKynapseLinesModel(); 00052 00057 virtual void init(std::string& str, bool useLocalCoord = false); 00058 00060 void update(); 00061 00062 protected: 00063 struct DtRegionalGeodeInfo 00064 { 00065 osg::ref_ptr<osg::PositionAttitudeTransform> myTransform; 00066 osg::ref_ptr<osg::Geode> myGeode; 00067 osg::ref_ptr<osg::Vec3dArray> myPoints; 00068 osg::ref_ptr<osg::Vec3dArray> myColors; 00069 osg::ref_ptr<osg::Geometry> myGeometry; 00070 osg::ref_ptr<osg::DrawElementsUInt> myPrimitive; 00071 00073 DtVector transformVec(const DtVector& inputVec); 00074 00075 void addLine(const DtVector& localStart, const DtVector& localEnd, 00076 const DtDebugDrawerGeometryMemoryColor& color); 00077 }; 00078 00079 virtual DtRegionalGeodeInfo findOrCreateRegonalNode(const DtVector& location); 00080 virtual void clearRegionalNodes(); 00081 virtual void drawMemoryBlock(unsigned long entries); 00082 makVrv::DtDe& myDe; 00083 std::list<DtRegionalGeodeInfo> myRegionalNodes; 00084 osg::ref_ptr<osg::Group> myGroupNode; 00085 DtDebugDrawerSharedMemoryManager* sharedMemory; 00086 std::vector<int> myLastFrameNumber; 00087 bool myUseLocalCoord; 00088 bool myFirstUpdate; 00089 }; 00090 00091 } 00092 00093 #endif