VR-Forces Development_Version Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes
makVrv::DtOsgOverlayPolygonModelInstance Class Reference

Model instance to draw a polygon on the overlay, either filled or outline. More...

Inheritance diagram for makVrv::DtOsgOverlayPolygonModelInstance:
Inheritance graph
[legend]

Classes

struct  VertexData

Public Types

typedef std::vector< VertexDataVertexList

Public Member Functions

 DtOsgOverlayPolygonModelInstance (DtDe &de)
 CTOR.
virtual ~DtOsgOverlayPolygonModelInstance ()
 DTOR.
virtual void setModelSet (int)
 Sets the model set this overlay item belongs to.
virtual void setPosition (int vtx, const DtVector &position)
 Set one of the endpoints of the Polygon.
virtual void setRotation (const osg::Quat &quat)
 Set the rotation of the polygon.
virtual void setOrigin (const DtVector &)
 Sets the origin. Will update geometry.
virtual void setGroup (int)
 The higher the Z order the "closer" to the eyepoint this element will be drawn.
virtual DtVector origin () const
 Returns the origin.
virtual void addPoint (const DtVector &point, int index)
 Add a new point to the polygon at the specified index, or, at the end if index is -1.
virtual void removePoint (int index)
 Removes the point from the specified index.
virtual void set2dOffset (int index, float x, float y)
 Sets the 2D offset of a vertex.
virtual void set3dDirection2dLength (int index, float x, float y, float z, float len)
 Sets a 3D direction with a 2D length of a vertex.
virtual void setColor (float r, float g, float b, float a)
 Set the color of the Polygon.
virtual void setTexturePath (const std::string &texturePath)
 Set the texture file path for the polygon.
virtual void setOutlineTexture (const std::string &texturePath)
 Sets the texture to use for the outline of the polygon.
virtual void setOutlineTexture (osg::Texture *texture)
 Sets the texture to use for the outline of the polygon.
virtual void setSolidFillCenter (bool)
 Sets to fill the center solid (if filled) not gradiant. Default is false.
virtual void setNumTextureTiles (double numTiles)
 Set the number of times to tile the texture.
virtual void setStipplePattern (unsigned int stipplePattern)
 Sets stipple pattern for the polygon.
virtual void setWidth (float width)
 Set the polygon outline width.
virtual void setEventWidth (float width)
 Set the polygon outline width.
virtual void setVisible (bool isVisible)
 Sets whether the model is visible or not.
bool updatesLocked () const
 Returns whether or not updates are locked.
virtual void setPickable (bool enabled)
 Sets whether or not the polygon is pickable.
virtual void setEventsEnabled (bool, unsigned long long userData)
 Sets whether or not mouse events are enabled.
bool eventsEnabled () const
 Gets whether or not mouse events are enabled.
virtual void setFill (bool)
 Sets whether or not polygon is filled.
virtual void setInsideColor (float r, float g, float b, float a)
 Set the color at the center of the ellipse.
virtual void getInsideColor (float &r, float &g, float &b, float &a)
 Retrieves the inside color.
virtual void setOutsideColor (float r, float g, float b, float a)
 Set the color on the outside of the ellipse.
virtual void getOutsideColor (float &r, float &g, float &b, float &a)
 Retrieves the inside color.
virtual int pointCount () const
 Retrieves the number of points in the model.
virtual DtVector point (int) const
 Retrieves the point.
virtual void setFillPattern (const std::vector< unsigned int > pattern)
 Sets fill pattern (32x32)
virtual void setOutline (bool)
 Sets the fact that, if the object is filled, also provide an outline scribe. Basically create a filled and outline polygon.
virtual void setChannelInstance (DtChannel *, int modelSet)
 Set to make this model channel specific.
virtual const VertexListvertexList () const
 Returns the vertex information for this polygon.
virtual void setPoints (const std::vector< DtVector > &points)
 Sets all the points for this polygon.
virtual void setVertexList (const VertexList &)
 Sets the vertex information for this polygon.
virtual const std::vector
< DtVector > & 
points () const
 Returns the list of vertices.
virtual void updateGeometry ()
 Updates the vertex information into the polygon (if not locked)
- Public Member Functions inherited from makVrv::DtModelInstance
 DtModelInstance (DtDe &de)
 CTOR.
virtual ~DtModelInstance ()
 DTOR.
virtual bool realize (DtModelDefinition &definition)
 Attempt to realize a definition.
const std::string & realizedDefinitionName () const
 Get the name of the definition that this model instance was realized with.
virtual bool saveModelToFile (const std::string &filename) const
 Attempt to save the model to a file.
const DtVectorboundingBoxExtents () const
 Get the bounding box extents of the model instance.
void getBoundingBoxExtents (double &x, double &y, double &z) const
 Get the bounding box extents of the model instance.
const DtVectorboundingBoxCenter () const
 Get the bounding box center of the model instance.
void getBoundingBoxCenter (double &x, double &y, double &z) const
 Get the bounding box center of the model instance.
void getBoundingBoxComponents (DtVector &minimum, DtVector &maximum)
virtual void setContributesToBound (bool trueOrFalse)
 Set whether this model instance contributes to an object's overall bounding volume.
bool contributesToBound () const
 Get whether this model instance contributes to an object's overall bounding volume.
virtual void setBlendColor (float r, float g, float b, float a)
 set the model's color
virtual void enableColorBlending (bool b)
 Enable / disable coloring on all models in the scene object Note about enableColorBlending: If this particular model has instancing enabled then this flag is set to false and color blending is handled by the instance manager.

Protected Member Functions

virtual void createPolygonIfNecessary ()
 Creates the appropriate polygon (filled out outline) and sets points.
virtual void updateColors ()
 Updates the colors of the object.
virtual void translateAndUpdateVertex (unsigned int index, const VertexData &vert, DtPolygon *polygon)
 Sets a polygon vertex's position.
virtual void channelUpdated (DtTacticalGraphicModelUpdaterManager::ChannelUpdateData)
 Update texture information with zoom and orientation changes.
virtual std::vector< DtVectortopographicVertices () const
 Converts all vertices from local coordinates to topographic. Easier to use for triangulation.

Protected Attributes

VertexList myVertices
std::vector< DtVectormyPoints
DtPolygonmyPolygon
DtPolygonmyOutlinePolygon
bool myFilled
float myWidth
osg::Vec4 myInnerColor
osg::Vec4 myOuterColor
unsigned int myStipplePattern
int myModelSet
unsigned long long myUserData
bool myEventsEnabled
bool myVisibleFlag
bool myOutline
bool mySolidFillCenter
osg::Vec3d myOrigin
osg::Quat myRotation
osg::ref_ptr< osg::Texture > myOutlineTexture
DtChannelmyChannelInstance
int myGroup
- Protected Attributes inherited from makVrv::DtModelInstance
DtDemyDe
std::string myRealizedModelDefinitionName
DtVector myBoundingBoxCenter
DtVector myBoundingBoxExtents
DtVector myBoundingBoxMinimum
DtVector myBoundingBoxMaximum
bool myContributesToBound
bool myColorBlendingEnabled
float myBlendRed
float myBlendBlue
float myBlendGreen
float myBlendAlpha

Additional Inherited Members

- Static Public Member Functions inherited from makVrv::DtModelInstance
static float readFloat (const std::string &paramName, const DtModelDefinition &definition)
static DtVector readVector (const std::string &paramName, const DtModelDefinition &definition)
- Public Attributes inherited from makVrv::DtModelInstance
boost::signal< void(DtModelInstance *)> signal_modelInstanceChanged

Detailed Description

Model instance to draw a polygon on the overlay, either filled or outline.

Member Typedef Documentation

Constructor & Destructor Documentation

makVrv::DtOsgOverlayPolygonModelInstance::DtOsgOverlayPolygonModelInstance ( DtDe de)

CTOR.

virtual makVrv::DtOsgOverlayPolygonModelInstance::~DtOsgOverlayPolygonModelInstance ( )
virtual

DTOR.

Member Function Documentation

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setModelSet ( int  )
virtual

Sets the model set this overlay item belongs to.

Will clear out channelInstance if set

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setPosition ( int  vtx,
const DtVector position 
)
virtual

Set one of the endpoints of the Polygon.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setRotation ( const osg::Quat &  quat)
virtual

Set the rotation of the polygon.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setOrigin ( const DtVector )
virtual

Sets the origin. Will update geometry.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setGroup ( int  )
virtual

The higher the Z order the "closer" to the eyepoint this element will be drawn.

Use this variable to stack overlay objects in the particular order you want them displayed

virtual DtVector makVrv::DtOsgOverlayPolygonModelInstance::origin ( ) const
virtual

Returns the origin.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::addPoint ( const DtVector point,
int  index 
)
virtual

Add a new point to the polygon at the specified index, or, at the end if index is -1.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::removePoint ( int  index)
virtual

Removes the point from the specified index.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::set2dOffset ( int  index,
float  x,
float  y 
)
virtual

Sets the 2D offset of a vertex.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::set3dDirection2dLength ( int  index,
float  x,
float  y,
float  z,
float  len 
)
virtual

Sets a 3D direction with a 2D length of a vertex.

This only works with outline polygons.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

Set the color of the Polygon.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setTexturePath ( const std::string &  texturePath)
virtual

Set the texture file path for the polygon.

The texture will be projected using the x-y coordinates of a topographic frame with the origin at some arbitrary point of the polygon.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setOutlineTexture ( const std::string &  texturePath)
virtual

Sets the texture to use for the outline of the polygon.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setOutlineTexture ( osg::Texture *  texture)
virtual

Sets the texture to use for the outline of the polygon.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setSolidFillCenter ( bool  )
virtual

Sets to fill the center solid (if filled) not gradiant. Default is false.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setNumTextureTiles ( double  numTiles)
virtual

Set the number of times to tile the texture.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setStipplePattern ( unsigned int  stipplePattern)
virtual

Sets stipple pattern for the polygon.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setWidth ( float  width)
virtual

Set the polygon outline width.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setEventWidth ( float  width)
virtual

Set the polygon outline width.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setVisible ( bool  isVisible)
virtual

Sets whether the model is visible or not.

Implements makVrv::DtModelInstance.

bool makVrv::DtOsgOverlayPolygonModelInstance::updatesLocked ( ) const

Returns whether or not updates are locked.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setPickable ( bool  enabled)
virtual

Sets whether or not the polygon is pickable.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setEventsEnabled ( bool  ,
unsigned long long  userData 
)
virtual

Sets whether or not mouse events are enabled.

bool makVrv::DtOsgOverlayPolygonModelInstance::eventsEnabled ( ) const

Gets whether or not mouse events are enabled.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setFill ( bool  )
virtual

Sets whether or not polygon is filled.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setInsideColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

Set the color at the center of the ellipse.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::getInsideColor ( float &  r,
float &  g,
float &  b,
float &  a 
)
virtual

Retrieves the inside color.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setOutsideColor ( float  r,
float  g,
float  b,
float  a 
)
virtual

Set the color on the outside of the ellipse.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::getOutsideColor ( float &  r,
float &  g,
float &  b,
float &  a 
)
virtual

Retrieves the inside color.

virtual int makVrv::DtOsgOverlayPolygonModelInstance::pointCount ( ) const
virtual

Retrieves the number of points in the model.

virtual DtVector makVrv::DtOsgOverlayPolygonModelInstance::point ( int  ) const
virtual

Retrieves the point.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setFillPattern ( const std::vector< unsigned int >  pattern)
virtual

Sets fill pattern (32x32)

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setOutline ( bool  )
virtual

Sets the fact that, if the object is filled, also provide an outline scribe. Basically create a filled and outline polygon.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setChannelInstance ( DtChannel ,
int  modelSet 
)
virtual

Set to make this model channel specific.

This means it will only update itself when the channel it is assigned to is updated. Enabled only to display on the channel/model set combination

virtual const VertexList& makVrv::DtOsgOverlayPolygonModelInstance::vertexList ( ) const
virtual

Returns the vertex information for this polygon.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setPoints ( const std::vector< DtVector > &  points)
virtual

Sets all the points for this polygon.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::setVertexList ( const VertexList )
virtual

Sets the vertex information for this polygon.

virtual const std::vector<DtVector>& makVrv::DtOsgOverlayPolygonModelInstance::points ( ) const
virtual

Returns the list of vertices.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::updateGeometry ( )
virtual

Updates the vertex information into the polygon (if not locked)

virtual void makVrv::DtOsgOverlayPolygonModelInstance::createPolygonIfNecessary ( )
protectedvirtual

Creates the appropriate polygon (filled out outline) and sets points.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::updateColors ( )
protectedvirtual

Updates the colors of the object.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::translateAndUpdateVertex ( unsigned int  index,
const VertexData vert,
DtPolygon polygon 
)
protectedvirtual

Sets a polygon vertex's position.

virtual void makVrv::DtOsgOverlayPolygonModelInstance::channelUpdated ( DtTacticalGraphicModelUpdaterManager::ChannelUpdateData  )
protectedvirtual

Update texture information with zoom and orientation changes.

virtual std::vector<DtVector> makVrv::DtOsgOverlayPolygonModelInstance::topographicVertices ( ) const
protectedvirtual

Converts all vertices from local coordinates to topographic. Easier to use for triangulation.

Member Data Documentation

VertexList makVrv::DtOsgOverlayPolygonModelInstance::myVertices
protected
std::vector<DtVector> makVrv::DtOsgOverlayPolygonModelInstance::myPoints
protected
DtPolygon* makVrv::DtOsgOverlayPolygonModelInstance::myPolygon
protected
DtPolygon* makVrv::DtOsgOverlayPolygonModelInstance::myOutlinePolygon
protected
bool makVrv::DtOsgOverlayPolygonModelInstance::myFilled
protected
float makVrv::DtOsgOverlayPolygonModelInstance::myWidth
protected
osg::Vec4 makVrv::DtOsgOverlayPolygonModelInstance::myInnerColor
protected
osg::Vec4 makVrv::DtOsgOverlayPolygonModelInstance::myOuterColor
protected
unsigned int makVrv::DtOsgOverlayPolygonModelInstance::myStipplePattern
protected
int makVrv::DtOsgOverlayPolygonModelInstance::myModelSet
protected
unsigned long long makVrv::DtOsgOverlayPolygonModelInstance::myUserData
protected
bool makVrv::DtOsgOverlayPolygonModelInstance::myEventsEnabled
protected
bool makVrv::DtOsgOverlayPolygonModelInstance::myVisibleFlag
protected
bool makVrv::DtOsgOverlayPolygonModelInstance::myOutline
protected
bool makVrv::DtOsgOverlayPolygonModelInstance::mySolidFillCenter
protected
osg::Vec3d makVrv::DtOsgOverlayPolygonModelInstance::myOrigin
protected
osg::Quat makVrv::DtOsgOverlayPolygonModelInstance::myRotation
protected
osg::ref_ptr<osg::Texture> makVrv::DtOsgOverlayPolygonModelInstance::myOutlineTexture
protected
DtChannel* makVrv::DtOsgOverlayPolygonModelInstance::myChannelInstance
protected
int makVrv::DtOsgOverlayPolygonModelInstance::myGroup
protected

The documentation for this class was generated from the following file:

Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (www.mak.com)