VisioDevKit  v2.0
 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 Member Functions

VgEngine::VgConstRefPtr
< Descriptor
getDescriptor () const
 
Vg3DModule::VgIGeometryType getType () const
 
- Public Member Functions inherited from Vg3DModule::VgIGeometry
 VgIGeometry ()
 Constructor. More...
 
virtual ~VgIGeometry ()
 Destructor. More...
 
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...
 
- 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...
 
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...
 
void setScale (float pScale)
 Sets the spatial's scale. More...
 
- 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...
 
void 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 Vg3DModule::VgInstanceFactory::instantiate) and then associate it with a layer (using setLayer).

...
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 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();
}
{
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

VgEngine::VgConstRefPtr< Descriptor > Vg3DModule::VgPoint::getDescriptor ( ) const
Returns
The descriptor
Vg3DModule::VgIGeometryType Vg3DModule::VgPoint::getType ( ) const
virtual
Returns
The geometry type.

Reimplemented from Vg3DModule::VgIGeometry.

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:
VisioDevKit 2.0, Visioglobe® 2013