PluginFunctions Namespace Reference

Classes

class  ObjectIterator
 Core Data Iterator. More...
class  BaseObjectIterator
 Core Data Iterator used to iterate over all objects (Including groups). More...

Functions

int viewerId ()
 Return unique viewer id.
bool object_exists (const int _identifier)
bool get_all_object_identifiers (std::vector< int > &_identifiers)
void get_all_objects (std::vector< BaseObjectData * > &_objects)
BaseObject *& objectRoot ()
 Get the root of the object structure.
bool getObject (int _identifier, PlaneObject *&_object)
PlaneNodeplaneNode (BaseObjectData *_object)
 Get a PlaneNode from an object.
PlaneObjectplaneObject (BaseObjectData *_object)
 Cast an BaseObject to a PlaneObject if possible.
Do never use!!



void setDataRoot (BaseObject *_root)
Examiner handling



int viewers ()
 Get the number of viewers.
void setActiveExaminer (const unsigned int _id)
 Set the active id of the examiner which got the last mouse events.
unsigned int activeExaminer ()
 Get the id of the examiner which got the last mouse events.
QString getEncodedExaminerView ()
 Get the encoded view for the active examiner.
QString getEncodedExaminerView (int _viewerId)
 Get the encoded view for the given.
void setEncodedExaminerView (QString _view)
 Set the encoded view for the active examiner.
void setEncodedExaminerView (int _viewerId, QString _view)
 Set the encoded view for the given.
QPoint mapToGlobal (const QPoint _point)
 Map coordinates of GL Widget to global coordinates.
QPoint mapToLocal (const QPoint _point)
 Map global coordinates to GL Widget local coordinates.
bool scenegraphPick (ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
bool scenegraphPick (const unsigned int _examiner, ACG::SceneGraph::PickTarget _pickTarget, const QPoint &_mousePos, unsigned int &_nodeIdx, unsigned int &_targetIdx, ACG::Vec3d *_hitPointPtr=0)
bool scenegraphRegionPick (ACG::SceneGraph::PickTarget _pickTarget, const QRegion &_region, QList< QPair< unsigned int, unsigned int > > &_list)
bool scenegraphRegionPick (const unsigned int _examiner, ACG::SceneGraph::PickTarget _pickTarget, const QRegion &_region, QList< QPair< unsigned int, unsigned int > > &_list)
void traverse (ACG::SceneGraph::MouseEventAction &_action)
void traverse (const unsigned int _examiner, ACG::SceneGraph::MouseEventAction &_action)
 Execute Scenegraph traversal with action and a specified examiner.
const std::string pickMode ()
 Get the current Picking mode.
void pickMode (std::string _mode)
 Set the current Picking mode for all examiner widgets.
Viewer::ActionMode actionMode ()
 Get the current Action mode.
void actionMode (Viewer::ActionMode _mode)
 Set the current Action Mode (PickMode,ExamineMode,...).
void shareGLWidget (QGLWidget *_widget)
 Sets the main QGLWidget for gl data sharing.
QGLWidget * shareGLWidget ()
 Returns the main QGLWidget for gl data sharing.
void getCurrentViewImage (QImage &_image)
 Returns a QImage of the current View.
void setSceneCenter (const ACG::Vec3d &_center, int _viewer)
const ACG::Vec3d & sceneCenter (int _viewer=ALL_VIEWERS)
 Get the current scene center.
void setViewObjectMarker (ViewObjectMarker *_marker)
void setDefaultViewObjectMarker (ViewObjectMarker *_marker)
ViewObjectMarkerdefaultViewObjectMarker ()
 Get the default ViewObjectMarker.
ACG::SceneGraph::BaseNodegetSceneGraphRootNode ()
 get scenegraph root node
ACG::SceneGraph::BaseNodegetRootNode ()
 Get the root node for data objects.
void addGlobalNode (ACG::SceneGraph::BaseNode *_node)
 Add a node under the root node.
void addObjectRenderingNode (ACG::SceneGraph::BaseNode *_node)
 Add scenegraph node modifing object rendering.
DLLEXPORT void allowRotation (bool _mode)
Setup Functions



void setViewers (std::vector< glViewer * > _viewerWidgets)
 Set the internal Viewer pointer ( DO NOT USE!! ).
void setViewerProperties (std::vector< Viewer::ViewerProperties * > _viewerProperties)
 Set the internal viewerProperties pointer ( DO NOT USE!! ).
glViewerviewer (int _viewerId)
 Get a Viewer.
void setDataSeparatorNodes (SeparatorNode *_dataRootNode)
 Set the internal data root node pointers ( DO NOT USE!! ).
void setSceneGraphRootNode (SeparatorNode *_root_node)
 Set the internal scenegraph root node pointer ( DO NOT USE!! ).
Active Objects



bool getPickedObject (const unsigned int _node_idx, BaseObjectData *&_object)
 Get the picked mesh.
bool getSourceMeshes (std::vector< PolyMesh * > &_meshes)
 Get a pointer to every Poly Mesh which is marked as a source mesh.
bool getTargetMeshes (std::vector< PolyMesh * > &_meshes)
 Get a pointer to every Poly Mesh which is marked as a target mesh.
bool getSourceMeshes (std::vector< TriMesh * > &_meshes)
 Get a pointer to every Triangle Mesh which is marked as a source mesh.
bool getTargetMeshes (std::vector< TriMesh * > &_meshes)
 Get a pointer to every Triangle Mesh which is marked as a target mesh.
Identifier handling



bool getSourceIdentifiers (std::vector< int > &_identifiers)
 Get the identifiers of all objects marked as a source object.
bool getTargetIdentifiers (std::vector< int > &_identifiers)
 Get the identifiers of all objects marked as a target object.
bool getObject (const int _identifier, BaseObject *&_object)
 Get the object which has the given identifier.
bool getObject (const int _identifier, BaseObjectData *&_object)
int getObjectId (const QString _name)
bool getAllMeshes (std::vector< int > &_identifiers)
 Get identifiers of all meshes.
int objectCount ()
 Get the number of available objects.
int targetCount ()
 Get the number of target objects.
int sourceCount ()
 Get the number of source objects.
int visibleCount ()
 Get the number of visible objects.
DLLEXPORT bool getAllObjectIdentifiers (std::vector< int > &_identifiers)
 Get identifiers of all objects.
DLLEXPORT bool objectExists (const int _identifier)
 Check if an object with this identifier exists.
bool getObject (int _identifier, PolyMeshObject *&_object)
bool getMesh (int _identifier, PolyMesh *&_mesh)
 Get the Poly Mesh which has the given identifier.
bool getMesh (int _identifier, TriMesh *&_mesh)
 Get the Triangle Mesh which has the given identifier.
View settings



void setBackColor (OpenMesh::Vec4f _color)
 Set the background color of the examiner widget.
void setFixedView (int _mode, int _viewer=ACTIVE_VIEWER)
 Set a fixed View for a viewer.
void setDrawMode (const unsigned int _mode, int _viewer=ALL_VIEWERS)
 Set the draw Mode of a Viewer.
.
unsigned int drawMode (int _viewer=ACTIVE_VIEWER)
 Get the current draw Mode of a Viewer.
void perspectiveProjection (int _viewer=ALL_VIEWERS)
 Switch to perspective Projection.
void orthographicProjection (int _viewer=ALL_VIEWERS)
 Switch to orthographic Projection.
void allowRotation (bool _mode, int _viewer)
bool allowRotation (int _viewer)
void setMainGLContext ()
 Set current GL Context to main context.
void viewingDirection (const ACG::Vec3d &_dir, const ACG::Vec3d &_up, int _viewer=ACTIVE_VIEWER)
 Set the viewing direction.
const ACG::Vec3d trackBallCenter (const ACG::Vec3d &_center, int _viewer)
 Get the trackball Center.
void setTrackBallCenter (const ACG::Vec3d &_center, int _viewer)
 Set the trackball Center.
void setScenePos (const ACG::Vec3d &_center, const double _radius, int _viewer=ALL_VIEWERS)
 Set the Scene position.
void setScenePos (const ACG::Vec3d &_center, int _viewer=ALL_VIEWERS)
 Set the scene position.
double sceneRadius ()
 Returns the current scene radius from the active examiner widget.
double sceneRadius (int _viewer)
 Returns the current scene radius from a given examiner viewer.
void translate (const ACG::Vec3d &_vector, int _viewer=ALL_VIEWERS)
 Translate viewer pos by given vector.
void rotate (const ACG::Vec3d &_axis, const double _angle, const ACG::Vec3d &_center, int _viewer=ALL_VIEWERS)
 Rotate Scene around axis.
void viewHome (int _viewer=ALL_VIEWERS)
 Go to home position.
void viewAll (int _viewer=ALL_VIEWERS)
 View the whole scene.
ACG::Vec3d viewingDirection (int _viewer=ALL_VIEWERS)
 Get the current viewing Direction.
bool isProjectionOrthographic (int _viewer=ACTIVE_VIEWER)
 Check if the projection is orthographic.
ACG::Vec3d eyePos (int _viewer=ACTIVE_VIEWER)
 Get the current viewer position.
ACG::Vec3d upVector (int _viewer=ALL_VIEWERS)
 Get the current up vector.
Viewer Status and properties



Viewer::ViewerPropertiesviewerProperties (int _id=ACTIVE_VIEWER)
 Get the viewer properties Use this functions to get basic viewer properties such as backgroundcolor or rendering options.
Animations



void flyTo (const ACG::Vec3d &_position, const ACG::Vec3d &_center, double _time)
 Fly to point and viewing direction (animated).
Getting data from objects and casting between them



BaseObjectDatabaseObjectData (BaseObject *_object)
 Cast an BaseObject to a BaseObjectData if possible.
PolyMeshpolyMesh (BaseObjectData *_object)
 Get a poly mesh from an object.
PolyMeshObjectpolyMeshObject (BaseObjectData *_object)
 Cast an BaseObject to a PolyMeshObject if possible.
PolyMeshObjectpolyMeshObject (int _objectId)
 Get an PolyMeshObject from the given id If possible.
TriMeshtriMesh (BaseObjectData *_object)
 Get a triangle mesh from an object.
TriMeshObjecttriMeshObject (BaseObjectData *_object)
 Cast an BaseObject to a TriMeshObject if possible.
TriMeshObjecttriMeshObject (int _objectId)
 Get an TriMeshObject from the given id If possible.

Variables

static BaseObjectobjectRoot_
 DONT USE DIRECTLY!!
static std::vector< glViewer * > examiner_widgets_
 DONT USE DIRECTLY!!
static std::vector
< Viewer::ViewerProperties * > 
viewerProperties_
 DONT USE DIRECTLY!!
static glViewerexaminer_widget_
 TODO : Remove this variable and implement multiView correctly here.
static unsigned int activeExaminer_ = 0
 Contains the currently active examiner.
static SeparatorNodedataRootNode_ = 0
 DONT USE DIRECTLY!!
static SeparatorNodedataSeparatorNode_ = 0
static SeparatorNodesceneGraphRootNode_ = 0
 Scenegraph root node.
static Viewer::ViewerProperties dummyProperties
 a dummy properties object returned as a reference if the real object does not exist
static ViewObjectMarkerdefaultMarker_ = 0
 DONT USE DIRECTLY!!
static QGLWidget * shareGLWidget_ = 0
 DONT USE DIRECTLY!!
static int viewerId_ = 0
const int ALL_VIEWERS = -2
const int ACTIVE_VIEWER = -1
const int VIEW_FREE = 0
const int VIEW_TOP = 1
const int VIEW_BOTTOM = 2
const int VIEW_LEFT = 3
const int VIEW_RIGHT = 4
const int VIEW_FRONT = 5
const int VIEW_BACK = 6

Iterators



typedef QStringList IteratorRestriction
const QStringList ALL_OBJECTS
const QStringList TARGET_OBJECTS ("target")
const QStringList SOURCE_OBJECTS ("source")
DLLEXPORT ObjectIterator objectsEnd ()
 Return Iterator to Object End.
DLLEXPORT BaseObjectIterator baseObjectsEnd ()
 Return Iterator to Object End.

Detailed Description

The Namespace PluginFunctions contains functions for all plugins. These functions should be used to get the objects to work on or to set modes in the examiner widget.

The Namespace PluginFunctions contains functions for all plugins.


Function Documentation

DLLEXPORT void PluginFunctions::addObjectRenderingNode ( ACG::SceneGraph::BaseNode _node  ) 

Add scenegraph node modifing object rendering.

This function adds nodes in front of the object root node. Therefore all objects renderings will be modified by the state changes in the added node. This might be usefull for adding for example a slicing node, which adds clipping planes such that the objects will be sliced.

DLLEXPORT void PluginFunctions::allowRotation ( bool  _mode  ) 

Lock scene rotation via mouse

Parameters:
_mode allow or disallow rotation
DLLEXPORT bool PluginFunctions::allowRotation ( int  _viewer = ACTIVE_VIEWER  ) 

is scene rotation locked

Parameters:
_viewer Id of the viewer to use. ALL_VIEWERS will set all viewers (Default) ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly
DLLEXPORT void PluginFunctions::allowRotation ( bool  _mode,
int  _viewer = ACTIVE_VIEWER 
)

Lock scene rotation via mouse

Parameters:
_mode allow or disallow rotation
_viewer Id of the viewer to use. ALL_VIEWERS will set all viewers (Default) ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly
DLLEXPORT BaseObjectData * PluginFunctions::baseObjectData ( BaseObject _object  ) 

Cast an BaseObject to a BaseObjectData if possible.

Parameters:
_object The object should be of type BaseObject. If the content is a BaseObjectData, a a BaseObjectData is returned. Otherwise a NULL pointer is returned.
DLLEXPORT unsigned int PluginFunctions::drawMode ( int  _viewer  ) 

Get the current draw Mode of a Viewer.

Get the current draw Mode of the examiner widget.

The DrawModes are defined at ACG/Scenegraph/DrawModes.hh
They can be combined.

Parameters:
_viewer Id of the viewer to use. ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly

Referenced by CoreWidget::slotUpdateGlobalDrawMenu(), and CoreWidget::slotUpdateViewerDrawMenu().

DLLEXPORT ACG::Vec3d PluginFunctions::eyePos ( int  _viewer = ACTIVE_VIEWER  ) 

Get the current viewer position.

Parameters:
_viewer Id of the viewer to use. ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly
DLLEXPORT void PluginFunctions::flyTo ( const ACG::Vec3d &  _position,
const ACG::Vec3d &  _center,
double  _time = 1000.0 
)

Fly to point and viewing direction (animated).

Fly to point and set new viewing direction (animated).

Parameters:
_position New viewer position ( the new eye point of the viewer )
_center The new scene center ( the point we are looking at )
_time Animation time in ms
void PluginFunctions::get_all_objects ( std::vector< BaseObjectData * > &  _objects  ) 

Returns a vector containing all currently available objects

Parameters:
_objects vector of all objects

Definition at line 889 of file PluginFunctions.cc.

References DATA_TRIANGLE_MESH, and objectsEnd().

DLLEXPORT bool PluginFunctions::getAllMeshes ( std::vector< int > &  _identifiers  ) 

Get identifiers of all meshes.

Parameters:
_identifiers ( vector returning the identifiers )
Returns:
false, if no mesh is found
DLLEXPORT bool PluginFunctions::getAllObjectIdentifiers ( std::vector< int > &  _identifiers  ) 

Get identifiers of all objects.

Parameters:
_identifiers ( vector returning the identifiers )
Returns:
false, if no mesh is found
DLLEXPORT bool PluginFunctions::getMesh ( int  _identifier,
TriMesh *&  _mesh 
)

Get the Triangle Mesh which has the given identifier.

Every loaded object has a unique identifier which is stored in the id field of the object container. Use this function to get the mesh which has this id. This can be used for a consistent mapping even if the data objects change during plugin operations (e.g. selection and main algorithm).
This function checks, if the object requested contains a mesh.

Parameters:
_identifier Object id to search for
_mesh returns the mesh
Returns:
Mesh found?
DLLEXPORT bool PluginFunctions::getMesh ( int  _identifier,
PolyMesh *&  _mesh 
)

Get the Poly Mesh which has the given identifier.

Every loaded object has a unique identifier which is stored in the id field of the object container. Use this function to get the mesh which has this id. This can be used for a consistent mapping even if the data objects change during plugin operations (e.g. selection and main algorithm).
This function checks, if the object requested contains a mesh.

Parameters:
_identifier Object id to search for
_mesh returns the mesh
Returns:
Mesh found?
DLLEXPORT bool PluginFunctions::getObject ( int  _identifier,
PolyMeshObject *&  _object 
)

This functions returns the object with the given id if it is a PolyMeshObject. See get_object( int _identifier , BaseObject*& _object ) for more details.

This functions returns the object with the given id if it is a TriMeshObject. See get_object( int _identifier , BaseObject*& _object ) for more details.

Definition at line 85 of file PluginFunctionsTriangleMesh.cc.

References BaseObject::childExists(), and objectRoot().

DLLEXPORT bool PluginFunctions::getObject ( int  _identifier,
PlaneObject *&  _object 
)

This functions returns the object with the given id if it is a PlaneObject. See get_object( int _identifier , BaseObject*& _object ) for more details.

DLLEXPORT bool PluginFunctions::getObject ( const int  _identifier,
BaseObjectData *&  _object 
)

This functions returns the object with the given id regardless of the type of object. See get_object( int _identifier , ject*& _object ) for more details.

DLLEXPORT bool PluginFunctions::getObject ( const int  _identifier,
BaseObject *&  _object 
)

Get the object which has the given identifier.

Every loaded object has a unique identifier which is stored in the id field of the object container. Use this function to get the object which has this id. This can be used for a consistent mapping even if the data objects change during plugin operations (e.g. selection and main algorithm).
This function only returns visible objects.

Parameters:
_identifier Object id to search for
_object returns the object
Returns:
Object found?

Referenced by Core::saveObject(), Core::saveObjectTo(), LoadWidget::showSave(), Core::slotEmptyObjectAdded(), Core::slotLoad(), Core::slotObjectOpened(), and Core::slotObjectUpdated().

DLLEXPORT int PluginFunctions::getObjectId ( const QString  _name  ) 

This functions returns the object's id with the given name.

DLLEXPORT bool PluginFunctions::getPickedObject ( const unsigned int  _node_idx,
BaseObjectData *&  _object 
)

Get the picked mesh.

Parameters:
_node_idx Node index returned by examiner picking
_object returns the object which contains the mesh
Returns:
true if mesh was found, false if picked object is not a mesh or not found

Referenced by MouseAndKeyPlugin::slotKeyEvent(), MouseAndKeyPlugin::slotMouseEvent(), and CoreWidget::updatePopupMenu().

DLLEXPORT ACG::SceneGraph::BaseNode * PluginFunctions::getRootNode (  ) 

Get the root node for data objects.

Get the root node for the objects. This node is a separator node. All nodes belonging to objects have to be placed below this node. Add a separatornode for each object below this node!

Referenced by CoreWidget::slotUpdateGlobalDrawMenu(), and CoreWidget::slotUpdateViewerDrawMenu().

DLLEXPORT ACG::SceneGraph::BaseNode * PluginFunctions::getSceneGraphRootNode (  ) 

get scenegraph root node

Get the real root node of the scenegraph.This node is the topmost node of the scenegraph. Normally you do not need to use this node. All objects should be added below the data root node which you can get with getRootNode().

Referenced by CoreWidget::CoreWidget(), CoreWidget::slotCoordSysVisibility(), CoreWidget::slotShowSceneGraphDialog(), CoreWidget::updatePopupMenu(), CoreWidget::updatePopupMenuBackground(), and glViewer::viewAll().

DLLEXPORT bool PluginFunctions::getSourceIdentifiers ( std::vector< int > &  _identifiers  ) 

Get the identifiers of all objects marked as a source object.

Parameters:
_identifiers ( vector returning the source object identifiers )
Returns:
false, if no object is selected as source
DLLEXPORT bool PluginFunctions::getSourceMeshes ( std::vector< TriMesh * > &  _meshes  ) 

Get a pointer to every Triangle Mesh which is marked as a source mesh.

Parameters:
_meshes ( vector returning the source meshes )
Returns:
false, if no mesh is selected as source
DLLEXPORT bool PluginFunctions::getSourceMeshes ( std::vector< PolyMesh * > &  _meshes  ) 

Get a pointer to every Poly Mesh which is marked as a source mesh.

Parameters:
_meshes ( vector returning the source meshes )
Returns:
false, if no mesh is selected as source
DLLEXPORT bool PluginFunctions::getTargetIdentifiers ( std::vector< int > &  _identifiers  ) 

Get the identifiers of all objects marked as a target object.

Parameters:
_identifiers ( vector returning the target object identifiers )
Returns:
false, if no object is selected as target
DLLEXPORT bool PluginFunctions::getTargetMeshes ( std::vector< TriMesh * > &  _meshes  ) 

Get a pointer to every Triangle Mesh which is marked as a target mesh.

Parameters:
_meshes ( vector returning the target meshes )
Returns:
false, if no mesh is selected as target
DLLEXPORT bool PluginFunctions::getTargetMeshes ( std::vector< PolyMesh * > &  _meshes  ) 

Get a pointer to every Poly Mesh which is marked as a target mesh.

Parameters:
_meshes ( vector returning the target meshes )
Returns:
false, if no mesh is selected as target
DLLEXPORT bool PluginFunctions::isProjectionOrthographic ( int  _viewer = ACTIVE_VIEWER  ) 

Check if the projection is orthographic.

Parameters:
_viewer Id of the viewer to use. ALL_VIEWERS will set all viewers (Default) ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly
DLLEXPORT QPoint PluginFunctions::mapToGlobal ( const QPoint  _point  ) 

Map coordinates of GL Widget to global coordinates.

DLLEXPORT QPoint PluginFunctions::mapToLocal ( const QPoint  _point  ) 

Map global coordinates to GL Widget local coordinates.

DLLEXPORT bool PluginFunctions::objectExists ( const int  _identifier  ) 

Check if an object with this identifier exists.

Searches through the Data containers and checks if the object with the given identifier exists

Parameters:
_identifier Object id to search for
DLLEXPORT void PluginFunctions::orthographicProjection ( int  _viewer = ALL_VIEWERS  ) 

Switch to orthographic Projection.

Parameters:
_viewer Id of the viewer to use. ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly

Referenced by Core::applyOptions(), and Core::slotObjectOpened().

DLLEXPORT void PluginFunctions::perspectiveProjection ( int  _viewer = ALL_VIEWERS  ) 

Switch to perspective Projection.

Parameters:
_viewer Id of the viewer to use. ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly

Referenced by Core::applyOptions(), and Core::slotObjectOpened().

DLLEXPORT PlaneNode * PluginFunctions::planeNode ( BaseObjectData _object  ) 

Get a PlaneNode from an object.

Parameters:
_object The object should be of type BaseDataObject. If the content is a plane, a PlaneNode will be returned. Otherwise a NULL pointer is returned.
DLLEXPORT PlaneObject * PluginFunctions::planeObject ( BaseObjectData _object  ) 

Cast an BaseObject to a PlaneObject if possible.

Parameters:
_object The object should be of type BaseDataObject. If the content is a plane, a a PlaneObject is returned. Otherwise a NULL pointer is returned.
DLLEXPORT PolyMesh * PluginFunctions::polyMesh ( BaseObjectData _object  ) 

Get a poly mesh from an object.

Parameters:
_object The object should be of type BaseDataObject. If the content is a poly Mesh, a poly mesh will be returned. Otherwise a NULL pointer is returned.

Referenced by MouseAndKeyPlugin::slotKeyEvent().

DLLEXPORT PolyMeshObject * PluginFunctions::polyMeshObject ( int  _objectId  ) 

Get an PolyMeshObject from the given id If possible.

Parameters:
_objectId Id of the requested Object. If the content is a volume, a a PolyMeshObject is returned. Otherwise a NULL pointer is returned.
DLLEXPORT PolyMeshObject * PluginFunctions::polyMeshObject ( BaseObjectData _object  ) 

Cast an BaseObject to a PolyMeshObject if possible.

Parameters:
_object The object should be of type BaseDataObject. If the content is a poly Mesh, a a PolyMeshObject is returned. Otherwise a NULL pointer is returned.
DLLEXPORT void PluginFunctions::rotate ( const ACG::Vec3d &  _axis,
const double  _angle,
const ACG::Vec3d &  _center,
int  _viewer = ALL_VIEWERS 
)

Rotate Scene around axis.

Rotates the current scene.

Parameters:
_axis Rotation axis
_angle Rotation Angle
_center Rotation Center
_viewer Id of the viewer to use. ALL_VIEWERS will set all viewers (Default) ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly
DLLEXPORT const ACG::Vec3d & PluginFunctions::sceneCenter ( int  _viewer  ) 

Get the current scene center.

Get scene center

DLLEXPORT bool PluginFunctions::scenegraphPick ( const unsigned int  _examiner,
ACG::SceneGraph::PickTarget  _pickTarget,
const QPoint &  _mousePos,
unsigned int &  _nodeIdx,
unsigned int &  _targetIdx,
ACG::Vec3d *  _hitPointPtr 
)

Execute picking operation on scenegraph This picking function will pick in the specified examiner context

DLLEXPORT bool PluginFunctions::scenegraphPick ( ACG::SceneGraph::PickTarget  _pickTarget,
const QPoint &  _mousePos,
unsigned int &  _nodeIdx,
unsigned int &  _targetIdx,
ACG::Vec3d *  _hitPointPtr 
)

Execute picking operation on scenegraph This picking function will pick in the last active examiner context which is automatically Set by mouseevents from the core

Referenced by MouseAndKeyPlugin::slotMouseEvent().

DLLEXPORT bool PluginFunctions::scenegraphRegionPick ( const unsigned int  _examiner,
ACG::SceneGraph::PickTarget  _pickTarget,
const QRegion &  _region,
QList< QPair< unsigned int, unsigned int > > &  _list 
)

Execute picking operation on scenegraph This picking function will pick in the specified examiner context

DLLEXPORT bool PluginFunctions::scenegraphRegionPick ( ACG::SceneGraph::PickTarget  _pickTarget,
const QRegion &  _region,
QList< QPair< unsigned int, unsigned int > > &  _list 
)

Execute picking operation on scenegraph This picking function will pick in the last active examiner context which is automatically Set by mouseevents from the core

DLLEXPORT double PluginFunctions::sceneRadius ( int  _viewer  ) 

Returns the current scene radius from a given examiner viewer.

Returns the Radius of the scene

Parameters:
_viewer Give the viewer which should be asked for its current scene radius
DLLEXPORT double PluginFunctions::sceneRadius (  ) 

Returns the current scene radius from the active examiner widget.

Returns the Radius of the scene

DLLEXPORT void PluginFunctions::setBackColor ( OpenMesh::Vec4f  _color  ) 

Set the background color of the examiner widget.

DLLEXPORT void PluginFunctions::setDataRoot ( BaseObject _root  ) 

Set the global DataContainer

Referenced by Core::init().

DLLEXPORT void PluginFunctions::setDefaultViewObjectMarker ( ViewObjectMarker _marker  ) 

Set the default ViewObjectMarker

Parameters:
_marker Object marker
DLLEXPORT void PluginFunctions::setDrawMode ( const unsigned int  _mode,
int  _viewer = ALL_VIEWERS 
)

Set the draw Mode of a Viewer.
.

The DrawModes are defined at ACG/Scenegraph/DrawModes.hh
They can be combined.

Parameters:
_viewer Id of the viewer to use. ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly

Referenced by Core::applyOptions(), and CoreWidget::slotGlobalDrawMenu().

DLLEXPORT void PluginFunctions::setFixedView ( int  _mode,
int  _viewer = ACTIVE_VIEWER 
)

Set a fixed View for a viewer.

Parameters:
_mode id for the mode
_viewer Id of the viewer to use. ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly

Referenced by Core::applyOptions(), Core::slotObjectOpened(), and CoreWidget::slotSetViewingDirection().

DLLEXPORT void PluginFunctions::setSceneCenter ( const ACG::Vec3d &  _center,
int  _viewer 
)

Set center of scene

DLLEXPORT void PluginFunctions::setScenePos ( const ACG::Vec3d &  _center,
int  _viewer = ALL_VIEWERS 
)

Set the scene position.

Same as setScenePos(const ACG::Vec3d& _center, double _radius) but reuses the current radius

Parameters:
_viewer Id of the viewer to use. ALL_VIEWERS will set all viewers (Default) ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly
DLLEXPORT void PluginFunctions::setScenePos ( const ACG::Vec3d &  _center,
const double  _radius,
int  _viewer = ALL_VIEWERS 
)

Set the Scene position.

Parameters:
_center Center of the current scene
_radius Radius of the scene ( Use scene_radius to get the current radius )
_viewer Id of the viewer to use. ALL_VIEWERS will set all viewers (Default) ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly
void PluginFunctions::setTrackBallCenter ( const ACG::Vec3d &  _center,
int  _viewer 
)

Set the trackball Center.

The scene is rotated around the trackball center when using the mouse

Parameters:
_center Center of the trackball
_viewer Id of the viewer to use. ALL_VIEWERS will set all viewers (Default) ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly
DLLEXPORT void PluginFunctions::setViewObjectMarker ( ViewObjectMarker _marker  ) 

Set current ViewObjectMarker (will be reseted to default on pick mode change)

Parameters:
_marker Object marker
const ACG::Vec3d PluginFunctions::trackBallCenter ( const ACG::Vec3d &  _center,
int  _viewer 
)

Get the trackball Center.

The scene is rotated around the trackball center when using the mouse

Parameters:
_center Center of the trackball
_viewer Id of the viewer to use. ALL_VIEWERS will set all viewers (Default) ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly
DLLEXPORT void PluginFunctions::translate ( const ACG::Vec3d &  _vector,
int  _viewer = ALL_VIEWERS 
)

Translate viewer pos by given vector.

Translates the scene by a given vector. ( This is only a view transformation and does not effect the scene center. To really translate the scene, use setScenePos );

Parameters:
_vector translation
_viewer Id of the viewer to use. ALL_VIEWERS will set all viewers (Default) ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly
DLLEXPORT void PluginFunctions::traverse ( ACG::SceneGraph::MouseEventAction _action  ) 

Execute Scenegraph traversal with action and use the last active examiner If you are reacting on a mouseEvent you should use this function as it will automatically set the right view

Referenced by MouseAndKeyPlugin::slotMouseEvent().

DLLEXPORT TriMesh * PluginFunctions::triMesh ( BaseObjectData _object  ) 

Get a triangle mesh from an object.

Parameters:
_object The object should be of type BaseDataObject. If the content is a triangle Mesh, a triangle mesh will be returned. Otherwise a NULL pointer is returned.

Referenced by MouseAndKeyPlugin::slotKeyEvent().

DLLEXPORT TriMeshObject * PluginFunctions::triMeshObject ( int  _objectId  ) 

Get an TriMeshObject from the given id If possible.

Parameters:
_objectId Id of the requested Object. If the content is a volume, a a TriMeshObject is returned. Otherwise a NULL pointer is returned.
DLLEXPORT TriMeshObject * PluginFunctions::triMeshObject ( BaseObjectData _object  ) 

Cast an BaseObject to a TriMeshObject if possible.

Parameters:
_object The object should be of type BaseDataObject. If the content is a triangle Mesh, a a TriMeshObject is returned. Otherwise a NULL pointer is returned.
DLLEXPORT ACG::Vec3d PluginFunctions::upVector ( int  _viewer = ALL_VIEWERS  ) 

Get the current up vector.

Parameters:
_viewer Id of the viewer to use. ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly
DLLEXPORT void PluginFunctions::viewAll ( int  _viewer = ALL_VIEWERS  ) 

View the whole scene.

Parameters:
_viewer Id of the viewer to use. ALL_VIEWERS will set all viewers (Default) ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly
DLLEXPORT int PluginFunctions::viewerId (  ) 

Return unique viewer id.

This function returns a id which is unique to all running Openflippers on that machine. This id changes when you restart the viewer!

DLLEXPORT Viewer::ViewerProperties & PluginFunctions::viewerProperties ( int  _id = ACTIVE_VIEWER  ) 
DLLEXPORT void PluginFunctions::viewHome ( int  _viewer = ALL_VIEWERS  ) 

Go to home position.

Parameters:
_viewer Id of the viewer to use. ALL_VIEWERS will set all viewers (Default) ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly
DLLEXPORT ACG::Vec3d PluginFunctions::viewingDirection ( int  _viewer = ALL_VIEWERS  ) 

Get the current viewing Direction.

Parameters:
_viewer Id of the viewer to use. ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly
DLLEXPORT void PluginFunctions::viewingDirection ( const ACG::Vec3d &  _dir,
const ACG::Vec3d &  _up,
int  _viewer = ACTIVE_VIEWER 
)

Set the viewing direction.

Parameters:
_dir direction
_up up vector
_viewer Id of the viewer to use. ALL_VIEWERS will set all viewers (Default) ACTIVE_VIEWER active viewer 0..3 Choose viewer explicitly

Variable Documentation

DONT USE DIRECTLY!!

The pointer to the beginning of the scenegraph nodes ( only the nodes belonging to objects ) Between the actual root node ( sceneGraphRootNode_ ) and this node global nodes could be added This pointer is internally used to access the scenegraphs root node

Definition at line 90 of file PluginFunctions.cc.

This node is used to add nodes between the root node of the scenegraph and the objects separator node. It is directly below the sceneGraphRootNode_

Definition at line 95 of file PluginFunctions.cc.

DONT USE DIRECTLY!!

This pointer is used internally

Definition at line 111 of file PluginFunctions.cc.

a dummy properties object returned as a reference if the real object does not exist

Definition at line 104 of file PluginFunctions.cc.

std::vector< glViewer* > PluginFunctions::examiner_widgets_ [static]

DONT USE DIRECTLY!!

This pointer is internally used to acces the examiner widget in the main apllication

Definition at line 70 of file PluginFunctions.cc.

DONT USE DIRECTLY!!

This Pointer will be used to access the data trees root in the plugin. Never use it directly as the internal Structure will change. Use the Access functions instead

Definition at line 64 of file PluginFunctions.cc.

QGLWidget* PluginFunctions::shareGLWidget_ = 0 [static]

DONT USE DIRECTLY!!

This pointer is used internally

Definition at line 117 of file PluginFunctions.cc.

int PluginFunctions::viewerId_ = 0 [static]

This is a unique id for the running OpenFlipper instance. Use it to identify yourself on the network

Definition at line 121 of file PluginFunctions.cc.

DONT USE DIRECTLY!!

This vector is used internally to access properties of all viewers

Definition at line 76 of file PluginFunctions.cc.


acg pic Project OpenFlipper, ©  Computer Graphics Group, RWTH Aachen. Documentation generated using doxygen .