VisioMove  2.1.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Friends Pages
Vg3DModule::VgPoint Class Reference

The VgPoint object can be associated with a layer within the 3D view. More...

Inheritance diagram for Vg3DModule::VgPoint:
Inheritance graph

Public Types

typedef VgPointDescriptor Descriptor
 
- Public Types inherited from Vg3DModule::VgIGeometry
typedef std::vector
< VgEngine::VgPosition
PositionVector
 

Public Member Functions

Vg3DModule::VgIGeometryType getType () const
 
VgEngine::VgAltitudeMode getAltitudeMode () const
 
void setAltitudeMode (const VgEngine::VgAltitudeMode &pAltitudeMode)
 Sets the altitude mode. More...
 
VgEngine::VgAnchorMode getAnchorPosition () const
 
void setAnchorPosition (const VgEngine::VgAnchorMode &pAnchorMode)
 Sets the anchor position. More...
 
float getGeometryConstantSizeDistance () const
 
void setGeometryConstantSizeDistance (float pDistanceInMeters)
 Sets the distance at which the VgPoint does not become bigger as you approach it. More...
 
bool isForceFrontFaceEnabled () const
 Sets the scale of the VgPoint when viewed from a distance equal to mGeometryConstantSizeDistance. More...
 
void setForceFrontFace (bool pEnable)
 Sets a flag to force the front face behavior. More...
 
VgEngine::VgOrientationConstraints getOrientationConstraints () const
 
void setOrientationConstraints (const VgEngine::VgOrientationConstraints &pConstraints)
 Sets new orientation constraints. More...
 
unsigned int getNbMarkers () const
 
VgEngine::VgRefPtr< VgMarkereditMarker (unsigned int pIndex)
 
bool insertMarker (const Vg3DModule::VgMarkerDescriptor *pMarkerDescriptor, int pMarkerPosition)
 Create and insert a new marker. More...
 
bool removeMarker (int pMarkerPosition)
 Remove the marker at a given index. More...
 
Vg3DModule::VgPointasPoint ()
 Casts this instance into a VgPoint. More...
 
Vg3DModule::VgLineasLine ()
 Casts this instance into a VgLine. More...
 
bool setSizePolicy (VgEngine::VgSizePolicy pSizePolicy)
 Changes the size policy of the VgPoint: VgEngine::eVgSizePolicyFixedScale: the mScale Parameter determines the scale of the VgPoint. More...
 
VgEngine::VgSizePolicy getSizePolicy () const
 Returns the current size policy of the VgPoint. More...
 
void getBoundingRect (float &pRectangleWidth, float &pRectangleHeight) const
 Returns the current BoundingRect of the VgPoint. More...
 
void setBoundingRect (float pRectangleWidth, float pRectangleHeight)
 Sets the current BoundingRect of the VgPoint. More...
 
- Public Member Functions inherited from Vg3DModule::VgIGeometry
 VgIGeometry ()
 Constructor. More...
 
virtual ~VgIGeometry ()
 Destructor. More...
 
virtual VgEngine::VgRefPtr
< VgEngine::VgLayer
getLayer ()
 
virtual void setLayer (VgEngine::VgRefPtr< VgEngine::VgLayer > pLayer, bool pHaveGeographicCoherence=true)
 Sets the associated layer. More...
 
virtual void addListener (VgEngine::VgRefPtr< Vg3DModule::VgIGeometryCallback > pCallback)
 Adds a listener to the geometry object. More...
 
virtual void removeListener (VgEngine::VgRefPtr< Vg3DModule::VgIGeometryCallback > pCallback)
 Removes a listener from the geometry object. More...
 
virtual const
VgEngine::VgVisibilityRamp 
getVisibilityRamp () const
 
virtual void setVisibilityRamp (const VgEngine::VgVisibilityRamp &pRamp)
 Sets the visibility ramp. More...
 
virtual const std::string & getID () const
 
virtual bool getNotifyPOISelectedOnClick () const
 
virtual void setNotifyPOISelectedOnClick (bool pValue)
 Sets the VgIGeometry to call the VgIMapModule::VgIPlaceListeners when the user clicks on the VgIGeometry. More...
 
virtual bool getBoundingPositions (PositionVector &pResult)
 Returns a vector of points that can be used to determine a viewpoint where one is guaranteed that the whole object is visible. More...
 
Vg3DModule::VgIGeometryasGeometry ()
 Casts this instance into a VgIGeometry. More...
 
- Public Member Functions inherited from VgEngine::VgSpatial
void setAnimation (const std::string &pAnimationName, VgEngine::VgRefPtr< VgEngine::VgAnimation > &pAnimation)
 Sets an animation on this spatial. More...
 
void setAnimation (VgEngine::VgRefPtr< VgEngine::VgAnimation > pAnimation)
 Sets an animation with an empty name on this spatial. More...
 
void setLocalAnimation (VgEngine::VgRefPtr< VgEngine::VgAnimation > pAnimation)
 Sets an animation on this spatial. More...
 
VgConstRefPtr< VgAnimationgetAnimation (const std::string &pName) const
 Gets an animation from the spatial's animation map. More...
 
VgRefPtr< VgAnimationeditAnimation (const std::string &pName)
 Edits an animation from the spatial's animation map. More...
 
void getAnimationNames (std::list< std::string > &pNameList) const
 Gets the list of the stored animation names. More...
 
VgEngine::VgPosition getPosition () const
 Gets spatial's position. More...
 
virtual void setPosition (const VgEngine::VgPosition &pPosition, bool pHaveGeographicCoherence=true)
 Sets the spatial position. More...
 
VgEngine::VgOrientation getOrientation () const
 Gets spatial's orientation. More...
 
void setOrientation (const VgEngine::VgOrientation &pOrientation)
 Sets the spatial orientation. More...
 
float getScale () const
 
void setScale (float pScale)
 Sets the spatial's scale. More...
 
int getZIndex () const
 
void setZIndex (int pZIndex)
 Sets the Z Index, an object with a smaller ZIndex will be drawn in front of another with a larger one. More...
 
bool isDrawnOnTop () const
 
void setDrawOnTop (bool pEnable)
 Sets the drawOnTop flag. More...
 
virtual void setVisible (bool pIsVisible)
 Sets the visibility. More...
 
virtual bool isVisible () const
 
- Public Member Functions inherited from VgEngine::VgReferenced
 VgReferenced ()
 Constructor. More...
 
 VgReferenced (const VgReferenced &pThis)
 Copy constructor. More...
 
virtual ~VgReferenced ()
 Destructor. More...
 
VgReferencedoperator= (const VgReferenced &pThis)
 Assignment operator. More...
 
void ref () const
 This method is used to add a reference to this object. More...
 
int unref () const
 This method is used to remove a reference to this object. More...
 
int getNbReferences () const
 Retrieves the number of references to this object. More...
 

Protected Member Functions

 VgPoint ()
 Constructor. More...
 
virtual ~VgPoint ()
 Destructor. More...
 
- Protected Member Functions inherited from VgEngine::VgSpatial
 VgSpatial ()
 Default constructor. More...
 
virtual ~VgSpatial ()
 Destructor. More...
 

Friends

class VgEngine::VgInstanceFactory
 
class VgEngine::VgObjectBridge
 

Additional Inherited Members

- Protected Attributes inherited from VgEngine::VgSpatial
Private * mPrivate
 Private. More...
 
- Protected Attributes inherited from VgEngine::VgReferenced
int mNbReferences
 The number of references to this object. More...
 

Detailed Description

The VgPoint object can be associated with a layer within the 3D view.

When the associated layer is visible, so to will the VgPoint. The VgPoint is located at a specified geographical position and is represented as a textured square.

To use a VgPoint, one must first create it (using VgEngine::VgInstanceFactory::instantiate) and then associate it with a layer (using setLayer).

Note
One should not have any references to VgPoint when the viewer instance is destroyed, otherwise it will crash if your reference is deallocated after the viewer.
...
VgApplication::VgIApplication* mVgApplication;
...
// Instantiate the VgPoint object.
VgEngine::VgRefPtr< Vg3DModule::VgPoint > lPoint = mVgApplication->editEngine()->editInstanceFactory()->instantiate(lPointDesc);
const VgEngine::VgLayerManager::LayerList& lLayers = mVgApplication->editEngine()->editLayerManager()->getLayers();
// Choose the first layer.
// Note: The Point will only be seen if the associated layer is visible. See VgEngine::VgVgLayer for more information.
lPoint->setLayer(lLayer);
// To hide the point. Pass true to show it again. By default, a point is visible.
lPoint->setVisible(false);
// To query its visibility
bool lIsVisible = lPoint->isVisible();
// To remove the Point from the layer.
lPoint->setLayer(NULL);
// If the point is no longer required, then we can release it's memory.
// But since it is reference counted we don't delete, we null-out the VgRefPtr.
lPoint = NULL;

Subclassing

It's possible to subclass VgPoint in order to add custom data. This is demonstrated by the following code snippet:

// Custom VgPoint class to encapsulate some additional information (just a simple string mName in this case)
class MyPoint : public Vg3DModule::VgPoint
{
public:
MyPoint(VgEngine::VgRefPtr< Vg3DModule::VgPoint >& pPoint, const std::string& pName)
: mPoint(pPoint)
, mName(pName)
{}
virtual ~MyPoint()
{
mPoint = NULL;
}
{
return mPoint->getType();
}
virtual const Vg3DModule::VgPointDescriptor& getDescriptor () const
{
return mPoint->getDescriptor();
}
{
return mPoint;
}
const std::string& getName () const
{
return mName;
}
protected:
// MyPoint specific information below
const std::string mName;
};

Once the Point is created, it can be wrapped by MyPoint and associated with a layer.

...
VgApplication::VgIApplication* mVgApplication;
...
VgEngine::VgRefPtr< Vg3DModule::VgPoint > lPoint = mApplication->editEngine()->editInstanceFactory()->instantiate(lPointDescr);
MyPoint* lMyPoint = new MyPoint(lPoint.get());
lMyPoint->getPoint()->setLayer(lLayerName);
Version
2.0

Member Typedef Documentation

Constructor & Destructor Documentation

Vg3DModule::VgPoint::VgPoint ( )
protected

Constructor.

virtual Vg3DModule::VgPoint::~VgPoint ( )
protectedvirtual

Destructor.

Member Function Documentation

Vg3DModule::VgLine* Vg3DModule::VgPoint::asLine ( )
virtual

Casts this instance into a VgLine.

Returns
A valid pointer if this instance as the correct type, NULL otherwise.
Version
2.0.9590

Reimplemented from Vg3DModule::VgIGeometry.

Vg3DModule::VgPoint* Vg3DModule::VgPoint::asPoint ( )
virtual

Casts this instance into a VgPoint.

Returns
Identifier.
Version
2.0.9334
2.1.0 moved to Vg3DModule::VgIGeometry::getID();
Deprecated:
const std::string& getID() const;
Returns
A valid pointer if this instance as the correct type, NULL otherwise.
Version
2.0.9590

Reimplemented from Vg3DModule::VgIGeometry.

VgEngine::VgRefPtr< VgMarker > Vg3DModule::VgPoint::editMarker ( unsigned int  pIndex)
Parameters
pIndexIndex of marker to edit.
Returns
The marker attached to this point at the specified index. NULL if there is no marker at this index.
Version
2.0.9263
VgEngine::VgAltitudeMode Vg3DModule::VgPoint::getAltitudeMode ( ) const
Returns
Altitude mode.
Version
2.0.9263
VgEngine::VgAnchorMode Vg3DModule::VgPoint::getAnchorPosition ( ) const
Returns
the anchor position.
Version
2.0.9263
void Vg3DModule::VgPoint::getBoundingRect ( float &  pRectangleWidth,
float &  pRectangleHeight 
) const

Returns the current BoundingRect of the VgPoint.

values of -1.0 means undefined.

Parameters
pRectangleWidth
pRectangleHeight
Version
2.1.0
float Vg3DModule::VgPoint::getGeometryConstantSizeDistance ( ) const
Returns
the distance at which the VgPoint does not become bigger as you approach it. When the camera is within this distance of the VgPoint, the visible size of the VgPoint on the screen will be the same as what it looked like when it was mGeometryConstantSizeDistance meters away. If set to 0.0, the size of the POI will be determined by mScale, regardless of it's distance from the camera. The default value of this property is 700.0.
Version
2.0.9263
unsigned int Vg3DModule::VgPoint::getNbMarkers ( ) const
Returns
Number of markers attached to this point.
Version
2.0.9263
VgEngine::VgOrientationConstraints Vg3DModule::VgPoint::getOrientationConstraints ( ) const
Returns
Orientation constraints.
Version
2.0.9263
VgEngine::VgSizePolicy Vg3DModule::VgPoint::getSizePolicy ( ) const

Returns the current size policy of the VgPoint.

For labels from MapEditor, the default is VgEnging::eVgSizePolicyFitBoundingRectangle for user created VgPoints, the default for VgPointDescriptor is VgEngine::eVgSizePolicyFixedScale

Returns
VgEngine::eVgSizePolicyFixedScale or VgEnging::eVgSizePolicyFitBoundingRectangle
Version
2.1.0
Vg3DModule::VgIGeometryType Vg3DModule::VgPoint::getType ( ) const
virtual
Returns
The geometry type.

Reimplemented from Vg3DModule::VgIGeometry.

bool Vg3DModule::VgPoint::insertMarker ( const Vg3DModule::VgMarkerDescriptor pMarkerDescriptor,
int  pMarkerPosition 
)

Create and insert a new marker.

Parameters
pMarkerDescriptorDescriptor of new marker to create and insert
pMarkerPositionPosition to insert the marker. Value of -1 means add at end. 0 means beginning. The markers shift on insertion.
Returns
true if the marker was added, otherwise false.
Version
2.1.0
bool Vg3DModule::VgPoint::isForceFrontFaceEnabled ( ) const

Sets the scale of the VgPoint when viewed from a distance equal to mGeometryConstantSizeDistance.

Returns
the scale of the VgPoint when viewed from a distance equal to mGeometryConstantSizeDistance. The default value of this property is 1.0.
Version
2.0.9263
2.1.0
Deprecated:
use setScale() (via VgEngine::VgSpatial) float getGeometryConstantSizeMaxScale() const;

The default value of this property is 1.0.

Version
2.0.9263
2.1.0
Deprecated:
use setScale() (via VgEngine::VgSpatial) void setGeometryConstantSizeMaxScale(float pMaxScale);
Returns
True if the front face behavior is forced.
Version
2.0.9263
bool Vg3DModule::VgPoint::removeMarker ( int  pMarkerPosition)

Remove the marker at a given index.

You cannot remove the last marker.

Parameters
pMarkerPositionPosition of marker to remove. Value of -1 means remove from end.
Returns
true if the marker was removed, otherwise false.
Version
2.1.0
void Vg3DModule::VgPoint::setAltitudeMode ( const VgEngine::VgAltitudeMode pAltitudeMode)

Sets the altitude mode.

Version
2.0.9263
void Vg3DModule::VgPoint::setAnchorPosition ( const VgEngine::VgAnchorMode pAnchorMode)

Sets the anchor position.

Version
2.0.9263
void Vg3DModule::VgPoint::setBoundingRect ( float  pRectangleWidth,
float  pRectangleHeight 
)

Sets the current BoundingRect of the VgPoint.

values of -1.0 means undefined. Usually called before setSizePolicy(VgEnging::eVgSizePolicyFitBoundingRectangle)

Parameters
pRectangleWidth
pRectangleHeight
Version
2.1.0
void Vg3DModule::VgPoint::setForceFrontFace ( bool  pEnable)

Sets a flag to force the front face behavior.

In cases where the camera can view the poi from behind, our engine will not display the label. For example this will happen if the VgPoint has a fixed orientation (it will not happen if it is always camera facing). Default value is false. Setting this to true will allow to view fixed VgPoints from behind.

Version
2.0.9263
void Vg3DModule::VgPoint::setGeometryConstantSizeDistance ( float  pDistanceInMeters)

Sets the distance at which the VgPoint does not become bigger as you approach it.

When the camera is within this distance of the VgPoint, the visible size of the VgPoint on the screen will be the same as what it looked like when it was mGeometryConstantSizeDistance meters away. If set to 0.0, the size of the POI will be determined by mScale, regardless of it's distance from the camera. The default value of this property is 700.0.

Version
2.0.9263
void Vg3DModule::VgPoint::setOrientationConstraints ( const VgEngine::VgOrientationConstraints pConstraints)

Sets new orientation constraints.

Version
2.0.9263
bool Vg3DModule::VgPoint::setSizePolicy ( VgEngine::VgSizePolicy  pSizePolicy)

Changes the size policy of the VgPoint: VgEngine::eVgSizePolicyFixedScale: the mScale Parameter determines the scale of the VgPoint.

VgEnging::eVgSizePolicyFitBoundingRectangle: the mScale of the VgPoint will be updated such that its markers will fit inside the BoundingRect.

Parameters
pSizePolicysize policy to use. If using VgEnging::eVgSizePolicyFitBoundingRectangle, make sure the mRectangleWidth and mRectangleHeight have correct values.
Returns
false if the pSizePolicy is VgEnging::eVgSizePolicyFitBoundingRectangle and BoudingRect has not been initialized.
Version
2.1.0

Friends And Related Function Documentation

friend class VgEngine::VgInstanceFactory
friend
friend class VgEngine::VgObjectBridge
friend

The documentation for this class was generated from the following file:
VisioMove 2.1.5, Visioglobe® 2015