VR-Forces 4.0.4 Class Documentation
include/vrvCore/DtMultiLineModel.h
Go to the documentation of this file.
00001 // /****************************************************************************** 
00002 // ** Copyright (c) 2012 MAK Technologies, Inc. 
00003 // ** All rights reserved. 
00004 // ******************************************************************************/ 
00005 
00009 
00010 #pragma once
00011 
00012 #include <vrvCore/vrvCore.h> 
00013 #include <vrvCore/DtModel.h> 
00014 #include <boost/unordered_map.hpp>
00015 
00016 namespace makVrv
00017 {
00018    class DtSegmentedLineModel;
00019 
00022    class DT_DLL_VRVCORE DtMultiLineModel : public DtModel
00023    {
00024    public:
00026       DtMultiLineModel(DtDe& de, DtUniqueID id);
00027 
00029       ~DtMultiLineModel();
00030 
00032       virtual void setSegmentColor(unsigned int segmentIndex,
00033          float r, float g, float b, float a);
00034 
00037       virtual void setSegmentStipplePattern(unsigned int segmentIndex,
00038          unsigned int stipplePattern);
00039 
00041       virtual void setSegmentWidth(unsigned int segmentIndex, double width);
00042 
00044       virtual void setPutOnOverlay(bool enabled);
00045       bool putOnOverlay() const
00046       {
00047          return myPutOnOverlay;
00048       }
00049 
00051       virtual void setVisible(bool);
00052 
00054 
00056       virtual void setSegmentColor(int line, unsigned int segmentIndex,
00057          float r, float g, float b, float a);
00058 
00061       virtual void setSegmentStipplePattern(int line, unsigned int segmentIndex,
00062          unsigned int stipplePattern);
00063 
00065       virtual void setSegmentWidth(int line, unsigned int segmentIndex, double width);
00066 
00068       virtual void addLineModel();
00069 
00071       virtual void removeLineModel(int);
00072 
00074       virtual void removeAllLineModels();
00075 
00078       virtual void setLineModels(int numberOfLines);
00079 
00081       virtual void setVisible(int line, bool);
00082 
00084       virtual void setPosition(int line, int vtx, const DtVector&);
00085 
00086    protected:
00089       virtual void addToScene( const DtUniqueID& sceneObjectId, int modelSet, 
00090           int visualizerType );
00091 
00093       virtual void removeFromScene();
00094 
00096       virtual void setSolid(bool soild);
00097 
00099       virtual DtSegmentedLineModel* createOverlayLineModel() = 0;
00100       virtual DtSegmentedLineModel* createGeometryLineModel() = 0;
00101 
00102    protected:
00103       typedef std::vector<DtSegmentedLineModel*> LineModels;
00104 
00105       LineModels myLineModels;
00106 
00107       struct Segment
00108       {
00109          Segment()
00110          : width(1.)
00111          , stipplePattern(0xFFFFFFFF)
00112          {
00113             color[0] = color[1] = color[2] = color[3] = 1.0f;
00114          }
00115 
00116          float width;
00117          int stipplePattern;
00118          float color[4];
00119       };
00120 
00121       typedef boost::unordered_map<int, Segment> Segments;
00122       Segments mySegments;
00123       bool myPutOnOverlay;
00124    };
00125 }
00126 

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)