class GraphViewer : public SoXtPlaneViewer

A SoXtPlaneViewer showing an iconic version of an Inventor scene graph

Inheritance:


Public Methods

void addDeselectionCallback(SoSelectionPathCB *f, void *userData = NULL)
represented by the deselected graph icon.
void addSelectionCallback(SoSelectionPathCB *f, void *userData = NULL)
represented by the selected graph icon.
void deselectAll()
Deselects the current selection
SoNode* getDisplayGraph()
Returns the scene graph representing the display graph
virtual Widget getWidget()
Redefine this from the base class
GraphViewer(Widget parent = NULL, const char *name = NULL)
void removeDeselectionCallback(SoSelectionPathCB *f, void *userData = NULL)
void removeSelectionCallback(SoSelectionPathCB *f, void *userData = NULL)
void select(SoPath *path)
anywhere in the path (i.e., there may be other nodes above it.
virtual void setSceneGraph(SoNode *newScene)
the graph itself
void update()
graph. Sets up the array of GraphIcons.
~GraphViewer()

Private Fields

SoNode* bufferNode
Copied/cut node from scene graph
SoOrthographicCamera* camera
Camera used to view scene
SoCallbackList* deselCBs
Deselection callbacks
DisplayGraph* displayGraph
Display graph
SoGroup* displayRoot
Root of display graph
SoEventCallback* ecb
Handles all mouse/kbd events
SbBool isGrabbing
TRUE if currently grabbing events
SbBool pasteByRef
TRUE if paste is by reference as opposed to copying
SoCoordinate3* pasteCoord
Coordinates for paste feedback line
SoSwitch* pasteSwitch
Root of paste feedback subgraph
SoTransform* pasteXform
Transform node in paste feedback
GraphIcon* pickedIcon
Icon hit by last selection pick
SbTime prevTime
Time of prev mouse press (to detect double-click)
SoBoxHighlightRenderAction* rendAct
Render action with box highlighting
SoCallbackList* selCBs
Selection callbacks
GraphIcon* selectedIcon
Currently-selected icon
SoSelection* selector
Selection node
SoNode* userScene
Scene we are displaying
Widget widget
Top level widget

Private Methods

void buildGraph(DisplayGraph *oldDisplayGraph)
Constructs a display graph from the current array of GraphIcons
Widget buildMenu(Widget parent)
Builds the top-bar menu widget
SoPath* buildPathToIconNode(GraphIcon *tailIcon)
Returns a path from the root of the user's scene graph down to the node represented by the given icon. The path is ref'ed.
Widget buildWidget(Widget parent)
Builds all widgets
SbBool changeSelection(int code)
Changes selection based on passed code: 0 = parent, 1 = first child, 2 = sibling to left, 3 = sibling to right. Nothing is done if the change is not valid. Returns update code.
void copy()
Copies current selection
static int countNodes(const SoNode *root, SbDict *nodeDict)
Counts nodes in subgraph rooted by node
SoNode* createPasteFeedback()
Creates and returns subgraph used for selection pasting feedback
virtual void createViewerButtons(Widget parent)
Redefine this to add only full viewer buttons (not the plane viewer stuff)
SbBool cut(SbBool saveSelection)
Cuts/clears current selection
static void deselectionCB(void *data, SoPath *path)
Callback to clear currently-selected icon and invoke callbacks
int getMousePressAction(SoEventCallback *ecb)
Returns action to be initiated by mouse press
GraphIcon* getSelectedIcon()
Returns GraphIcon corresponding to current selected icon, or NULL
void invokeCallbacks(SbBool selecting)
Invokes user-supplied selection or deselection callbacks
static void menuButtonCB(Widget, XtPointer, XtPointer)
static void menuDisplayCB(Widget, XtPointer, XtPointer)
Callbacks for menu display and menu button press
static void mousePressCB(void *data, SoEventCallback *ecb)
Callback for mouse button presses
void movePasteFeedback(const SoEvent *event, SbBool doPaste)
Moves paste feedback to follow cursor, given event containing position
static void nodeCreationCB(void *data, SoNode *newNode)
Callback for NodeCreator
void pasteBegin(SoEventCallback *ecb)
Begins selection pasting
static void pasteEndCB(void *data, SoEventCallback *ecb)
static void pasteMoveCB(void *data, SoEventCallback *ecb)
Callbacks for mouse motion and button presses during selection pasting
void processAction(int action, SoEventCallback *ecb)
Processes action initiated by menu or key press
void resetPasteFeedback()
Resets paste feedback to initial state
void select(GraphIcon *icon)
Changes selection to be given icon
static void selectionCB(void *data, SoPath *path)
Callback to store currently-selected icon and invoke callbacks
static SoPath* selectionFilterCB(void *data, const SoPickedPoint *pick)
Callback to prune a selected path that extends to a shape in an icon to end at the root of the icon

Documentation

A SoXtPlaneViewer showing an iconic version of an Inventor scene graph. This iconic version is referred to as the display graph.

GraphViewer(Widget parent = NULL, const char *name = NULL)

~GraphViewer()

virtual void setSceneGraph(SoNode *newScene)
the graph itself

void update()
graph. Sets up the array of GraphIcons.

void select(SoPath *path)
anywhere in the path (i.e., there may be other nodes above it.

void deselectAll()
Deselects the current selection

void addSelectionCallback(SoSelectionPathCB *f, void *userData = NULL)
represented by the selected graph icon.

void removeSelectionCallback(SoSelectionPathCB *f, void *userData = NULL)

void addDeselectionCallback(SoSelectionPathCB *f, void *userData = NULL)
represented by the deselected graph icon.

void removeDeselectionCallback(SoSelectionPathCB *f, void *userData = NULL)

virtual Widget getWidget()
Redefine this from the base class

SoNode* getDisplayGraph()
Returns the scene graph representing the display graph

SoNode* userScene
Scene we are displaying

SoGroup* displayRoot
Root of display graph

SoOrthographicCamera* camera
Camera used to view scene

SoSelection* selector
Selection node

SoSwitch* pasteSwitch
Root of paste feedback subgraph

SoTransform* pasteXform
Transform node in paste feedback

SoCoordinate3* pasteCoord
Coordinates for paste feedback line

SoEventCallback* ecb
Handles all mouse/kbd events

DisplayGraph* displayGraph
Display graph

GraphIcon* pickedIcon
Icon hit by last selection pick

GraphIcon* selectedIcon
Currently-selected icon

SoNode* bufferNode
Copied/cut node from scene graph

SbBool pasteByRef
TRUE if paste is by reference as opposed to copying

SbBool isGrabbing
TRUE if currently grabbing events

SbTime prevTime
Time of prev mouse press (to detect double-click)

SoCallbackList* selCBs
Selection callbacks

SoCallbackList* deselCBs
Deselection callbacks

Widget widget
Top level widget

SoBoxHighlightRenderAction* rendAct
Render action with box highlighting

virtual void createViewerButtons(Widget parent)
Redefine this to add only full viewer buttons (not the plane viewer stuff)

Widget buildWidget(Widget parent)
Builds all widgets

Widget buildMenu(Widget parent)
Builds the top-bar menu widget

void buildGraph(DisplayGraph *oldDisplayGraph)
Constructs a display graph from the current array of GraphIcons. Sets the viewer to display it. Takes old display graph which it passes to DisplayGraph::build().

static int countNodes(const SoNode *root, SbDict *nodeDict)
Counts nodes in subgraph rooted by node

static SoPath* selectionFilterCB(void *data, const SoPickedPoint *pick)
Callback to prune a selected path that extends to a shape in an icon to end at the root of the icon

static void selectionCB(void *data, SoPath *path)
Callback to store currently-selected icon and invoke callbacks

static void deselectionCB(void *data, SoPath *path)
Callback to clear currently-selected icon and invoke callbacks

static void menuDisplayCB(Widget, XtPointer, XtPointer)
Callbacks for menu display and menu button press

static void menuButtonCB(Widget, XtPointer, XtPointer)

static void mousePressCB(void *data, SoEventCallback *ecb)
Callback for mouse button presses

int getMousePressAction(SoEventCallback *ecb)
Returns action to be initiated by mouse press

void processAction(int action, SoEventCallback *ecb)
Processes action initiated by menu or key press

GraphIcon* getSelectedIcon()
Returns GraphIcon corresponding to current selected icon, or NULL

SbBool changeSelection(int code)
Changes selection based on passed code: 0 = parent, 1 = first child, 2 = sibling to left, 3 = sibling to right. Nothing is done if the change is not valid. Returns update code.

void select(GraphIcon *icon)
Changes selection to be given icon

void invokeCallbacks(SbBool selecting)
Invokes user-supplied selection or deselection callbacks

SoNode* createPasteFeedback()
Creates and returns subgraph used for selection pasting feedback

SoPath* buildPathToIconNode(GraphIcon *tailIcon)
Returns a path from the root of the user's scene graph down to the node represented by the given icon. The path is ref'ed.

void copy()
Copies current selection

SbBool cut(SbBool saveSelection)
Cuts/clears current selection

void pasteBegin(SoEventCallback *ecb)
Begins selection pasting

static void pasteMoveCB(void *data, SoEventCallback *ecb)
Callbacks for mouse motion and button presses during selection pasting

static void pasteEndCB(void *data, SoEventCallback *ecb)

void movePasteFeedback(const SoEvent *event, SbBool doPaste)
Moves paste feedback to follow cursor, given event containing position

void resetPasteFeedback()
Resets paste feedback to initial state

static void nodeCreationCB(void *data, SoNode *newNode)
Callback for NodeCreator


This class has no child classes.
Author:
Silicon Graphics Inc., extensions by Andreas Lücke
Version:
0.0
See Also:
FieldEditor

alphabetic index hierarchy of classes


This page is part of the tsKit's reference manual by Andreas Lücke.
Back to tsKit-Home

generated by doc++