Locators

group FnBaseLocator

Typedefs

typedef FnBaseLocator *(*LocatorCreateCallback)()

A callback function type for FnBaseLocator::create().

typedef bool(* Foundry::Katana::ViewerUtils::LocatorMatchesCallback)(const Foundry::Katana::ViewerAPI::ViewerLocationEvent &event)

A callback function type for FnBaseLocator::matches().

typedef FnAttribute::DoubleAttribute(* Foundry::Katana::ViewerUtils::LocatorGetBoundsCallback)(const Foundry::Katana::ViewerAPI::ViewerLocationEvent &event)

A callback function type for FnBaseLocator::getBounds().

typedef FnAttribute::DoubleAttribute(* Foundry::Katana::ViewerUtils::LocatorComputeExtentCallback)(const Foundry::Katana::ViewerAPI::ViewerLocationEvent &event)

A callback function type for FnBaseLocator::computeExtent().

typedef bool(* Foundry::Katana::ViewerUtils::OverridesBaseGeometryCallback)(const Foundry::Katana::ViewerAPI::ViewerLocationEvent &event)

A callback function type for FnBaseLocator::overridesBaseGeometry().

class FnBaseLocator
#include <FnBaseLocator.h>

Base class implementing a locator plug-in that is used to customize how an object that’s represented by a scene graph location is drawn. Each locator plug-in will be instantiated once per viewport, and is used to draw the geometry for multiple matching locations.

Public Types

typedef std::shared_ptr<FnBaseLocator> Ptr

Shared pointer type.

typedef std::weak_ptr<FnBaseLocator> WeakPtr

Weak pointer type.

Public Functions

FnBaseLocator()
virtual ~FnBaseLocator()
virtual void setup() = 0

Called after the object has been created to initialize resources (called with a valid OpenGL context).

virtual void cleanup() = 0

Allows the object to clean up resources (called with a valid OpenGL context).

virtual void locationSetup(const std::string &locationPath, bool isPicking)

Called immediately before a location is drawn.

virtual void locationCleanup(const std::string &locationPath, bool isPicking)

Called immediately after a location is drawn.

virtual void draw(const std::string &locationPath) = 0

Draws the object that’s represented by the scene graph location with the given path using the given shader program.

virtual void pickerDraw(const std::string &locationPath) = 0

Draws the object that’s represented by the scene graph location with the given path using the given shader program as part of a picking pass.

virtual void onFrameBegin(bool isPicking)

Called at the beginning of each frame to allow batching of draws.

virtual void onFrameEnd(bool isPicking)

Called at the end of each frame to allow batching of draws.

FnBaseLocatorVDC *getViewerDelegateComponent() const

Returns the ViewerDelegateComponent for querying scene data.

void setViewerDelegateComponent(FnBaseLocatorVDC *vdc)

Sets the ViewerDelegateComponent for querying scene data.

FnBaseLocatorViewportLayer *getViewportLayer() const

Returns the ViewportLayer that owns this object.

void setViewportLayer(FnBaseLocatorViewportLayer *vdc)

Sets the ViewportLayer that owns this object.

FnAttribute::Attribute getAttribute(const std::string &locationPath, const std::string &attrName = "")

Returns the named attribute of the scene graph location with the given path, or all attributes if an attribute name is not specified.

bool isLocationSelected(const std::string &locationPath)

Returns true if the scene graph location with the given path is currently selected.

GLShaderProgram *getDefaultShaderProgram() const

Returns the default shading shader program.

void setDefaultShaderProgram(GLShaderProgram *shaderProgram)

Sets the default shading shader program.

class FnBaseLocatorVDC
#include <FnBaseLocator.h>

A base implementation of a ViewerDelegateComponent which tracks/maintains a tree of SceneNode objects and locator plug-ins associated with each location represented by a SceneNode.

Inherits from Foundry::Katana::ViewerAPI::ViewerDelegateComponent

Public Functions

FnBaseLocatorVDC()
virtual ~FnBaseLocatorVDC()
virtual void setup()

Initializes this ViewerDelegateComponent.

virtual void cleanup()

Cleans up this ViewerDelegateComponent.

virtual bool locationEvent(const Foundry::Katana::ViewerAPI::ViewerLocationEvent &event, bool locationHandled)

Handles viewer location events and maintains the SceneNode tree.

virtual void locationsSelected(const std::vector<std::string> &locationPaths)

Tracks the selection state of the scene graph.

virtual void *getPrivateData(void *inputData)

Returns private data.

virtual FnAttribute::DoubleAttribute getBounds(const std::string &locationPath)

Gets the bounds of the given location.

virtual FnAttribute::DoubleAttribute computeExtent(const std::string &locationPath)

Computes the extent of the given location.

void removeLocation(const std::string &locationPath)

Handles the removal of scene nodes from the selected path.

virtual SceneNode::Ptr createSceneNode(const FnKat::ViewerAPI::ViewerLocationEvent &event)

Creates a new SceneNode instance based on the given viewer location event. Can be overridden if a custom SceneNode type is desired.

void dirtyAllViewports()

Marks all viewports attached to the ViewerDelegate as dirty.

SceneNode::Ptr getRootSceneNode() const

Returns the top-level SceneNode.

std::weak_ptr<LocatorLocationsMap> getLocatorLocations()

Returns a map of locator plug-ins and the scene graph locations associated with them.

bool isLocationSelected(const std::string &locationPath)

Returns true if the scene graph location with the given path is currently selected.

bool isLocationHidden(const std::string &locationPath)

Returns true if the passed location is hidden.

Public Static Functions

static void flush()

Flush plugin Caches.

Allows to discard any cache for this plugin when a Flush Caches event occurs.

static FnKat::ViewerAPI::ViewerDelegateComponent *create()
static void registerLocator(const std::string &name, LocatorCreateCallback create, LocatorMatchesCallback matches, LocatorMatchesCallback overridesBaseGeometry, LocatorGetBoundsCallback getBounds, LocatorComputeExtentCallback computeExtent)

Registers a locator class and its callbacks with this VDC.

static LocatorContainerVector getRegisteredLocators()

Returns the list of registered locator plug-in classes.

class FnBaseLocatorViewportLayer
#include <FnBaseLocator.h>

Class implementing a ViewportLayer that owns instances of locator plug-ins and is responsible for drawing them.

Inherits from Foundry::Katana::ViewerAPI::ViewportLayer

Public Functions

FnBaseLocatorViewportLayer()
virtual ~FnBaseLocatorViewportLayer()
virtual void freeze()

Freezes the ViewportLayer when the viewport widget is hidden.

Allows the ViewportLayer to freeze its activities when the viewport is not visible. This allows the ViewerDelegate to stop any kind of unecessary processing that might happen during that time.

virtual void thaw()

Thaws the ViewportLayer when the viewport widget is shown.

Allows the ViewportLayer to restart its activities when the viewport becomes visible. This restarts the activities paused by freeze().

This function is exposed in the Viewport Python class.

virtual void setup()

Initializes the GL components of the ViewportLayer.

virtual void cleanup()

Cleans up the ViewportLayer resources.

virtual void draw()

Draws the viewport layer’s contents.

virtual void pickerDraw(unsigned int x, unsigned int y, unsigned int w, unsigned int h, const Foundry::Katana::ViewerAPI::PickedAttrsMap &ignoreAttrs)

Draws the viewport layer’s contents for a selection picker pass.

virtual bool usesPickingOnHover()

Returns true if the viewport layer picks objects when the pointer is hovering over them.

virtual void resize(unsigned int width, unsigned int height)

Processes viewport resizing.

virtual void setOption(Foundry::Katana::ViewerAPI::OptionIdGenerator::value_type optionId, FnAttribute::Attribute attr)

Sets a generic option.

virtual void initializeLocators()

Creates all needed local instances of locator plug-ins.

virtual void drawLocators(bool isPicking, std::set<std::string> &ignoreLocations)

Draws locator plug-ins for their associated locations, optionally ignoring locations with the given scene graph location paths.

Public Static Functions

static Foundry::Katana::ViewerAPI::ViewportLayer *create()