This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
基础
专业(SIM)
UnigineEditor
界面概述
资源工作流程
Version Control
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
统一的Unigine着色器语言 UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

Unigine::Plugins::SpiderVision::ViewportData Class

Header: #include <plugins/Unigine/SpiderVision/UnigineSpiderVision.h>

The object of this class stores all data on the viewport: transformations, viewport type settings, physical size of the display, VFOV, aspect, vertical and horizontal offsets, warping effect details, etc.

This object is accessible via the corresponding methods of the DisplaysConfig class.

The mask data are stored in the configuration file.

ViewportData Class

枚举

WINDOW_MODE#

Name描述
WINDOW_MODE_WINDOW = 0Window mode.
WINDOW_MODE_FULLSCREEN_FREE = 1Fullscreen imitation — frameless window adapted to the full window area.

POINT_SMOOTH_TYPE#

Name描述
POINT_SMOOTH_TYPE_LINEAR = 0Linear interpolation is applied for curving of the line on both sides of the point.
POINT_SMOOTH_TYPE_SMOOTH = 1Symmetric control handles for smooth curves on both sides of the point.
POINT_SMOOTH_TYPE_BREAK = 2Asymmetric control handles for an independent control of each handle.
POINT_SMOOTH_TYPE_AUTO = 3Automatic smooth line curving, no control handles available.
POINT_SMOOTH_TYPE_NUM = 4Total number of line curving modes.

DISPLAY_TRANSFORM_TYPE#

Name描述
DISPLAY_TRANSFORM_TYPE_DISPLAY = 0Display viewport.
DISPLAY_TRANSFORM_TYPE_PROJECTOR = 1Projector (beamer) viewport.

Members

int getID() const#

Returns the current viewport ID.

Return value

Current viewport ID.

void setName ( const char * name ) #

Sets a new viewport name.

Arguments

  • const char * name - The viewport name.

const char * getName() const#

Returns the current viewport name.

Return value

Current viewport name.

void setComputerName ( const char * name ) #

Sets a new name of the computer, on which this viewport is to be rendered.

Arguments

  • const char * name - The name of the computer, on which this viewport is to be rendered. If not set, the viewport is rendered on any PC.

const char * getComputerName() const#

Returns the current name of the computer, on which this viewport is to be rendered.

Return value

Current name of the computer, on which this viewport is to be rendered. If not set, the viewport is rendered on any PC.

void setDisplayIndex ( int index ) #

Sets a new display index.

Arguments

  • int index - The display index.

int getDisplayIndex() const#

Returns the current display index.

Return value

Current display index.

void setWindowSize ( const Math::ivec2& size ) #

Sets a new size of the window, if it is in the Window mode.

Arguments

  • const Math::ivec2& size - The window size.

Math::ivec2 getWindowSize() const#

Returns the current size of the window, if it is in the Window mode.

Return value

Current window size.

void setWindowPosition ( const Math::ivec2& position ) #

Sets a new window position on the screen.

Arguments

  • const Math::ivec2& position - The coordinates of the top left corner of the window on the screen.

Math::ivec2 getWindowPosition() const#

Returns the current window position on the screen.

Return value

Current coordinates of the top left corner of the window on the screen.

void setWindowMode ( ViewportData::WINDOW_MODE mode ) #

Sets a new window mode for the rendered viewport: fullscreen imitation (frameless window adapted to the full window area) or window.

Arguments


ViewportData::WINDOW_MODE getWindowMode() const#

Returns the current window mode for the rendered viewport: fullscreen imitation (frameless window adapted to the full window area) or window.

Return value

Current window mode for the rendered viewport.

void setProjectionEnabled ( bool enabled ) #

Sets a new value indicating if the projection rendering in viewport is enabled.

Arguments

  • bool enabled - Set true to enable projection rendering; false - to disable it.

bool isProjectionEnabled() const#

Returns the current value indicating if the projection rendering in viewport is enabled.

Return value

true if projection rendering is enabled; otherwise false.

void setPosition ( const Math::vec3& position ) #

Sets a new viewport position relative to the viewpoint in the setup.

Arguments

  • const Math::vec3& position - The viewport position relative to the viewpoint in the setup.

Math::vec3 getPosition() const#

Returns the current viewport position relative to the viewpoint in the setup.

Return value

Current viewport position relative to the viewpoint in the setup.

void setRotation ( const Math::vec3& rotation ) #

Sets a new viewport rotation relative to its own center in the setup.

Arguments

  • const Math::vec3& rotation - The viewport rotation relative to its own center in the setup.

Math::vec3 getRotation() const#

Returns the current viewport rotation relative to its own center in the setup.

Return value

Current viewport rotation relative to its own center in the setup.

void setOffset ( const Math::vec2& offset ) #

Sets a new offset of the FOV.

Arguments

  • const Math::vec2& offset - The FOV offset.

Math::vec2 getOffset() const#

Returns the current offset of the FOV.

Return value

Current FOV offset.

void setType ( ViewportData::DISPLAY_TRANSFORM_TYPE type ) #

Sets a new type of the projection matrix distortion applied to the viewport: display or projector.

Arguments


ViewportData::DISPLAY_TRANSFORM_TYPE getType() const#

Returns the current type of the projection matrix distortion applied to the viewport: display or projector.

Return value

Current projection matrix distortion type applied to the viewport.

void setSize ( const Math::vec2& size ) #

Sets a new physical size of the display.

Arguments

  • const Math::vec2& size - The physical size of the display.

Math::vec2 getSize() const#

Returns the current physical size of the display.

Return value

Current physical size of the display.

void setAspect ( float aspect ) #

Sets a new aspect ratio for the projector.

Arguments

  • float aspect - The aspect ratio for the projector.

float getAspect() const#

Returns the current aspect ratio for the projector.

Return value

Current aspect ratio for the projector.

void setVFov ( float vfov ) #

Sets a new vertical field of view for the projector.

Arguments

  • float vfov - The vertical field of view for the projector, in degrees.

float getVFov() const#

Returns the current vertical field of view for the projector.

Return value

Current vertical field of view for the projector, in degrees.

void setGroupID ( int id ) #

Sets a new ID of the group of viewports.

Arguments

  • int id - The ID of the group of viewports.

int getGroupID() const#

Returns the current ID of the group of viewports.

Return value

Current ID of the group of viewports.

static Event<ViewportData*> getEventBaseChanged() const#

event triggered on changing basic viewport parameters (width, height, position, rotation, etc.). You can subscribe to events via connect()   and unsubscribe via disconnect(). You can also use EventConnection and EventConnections classes for convenience (see examples below).
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(ViewportData *viewport_data)

Usage Example

Source code (C++)
// implement the BaseChanged event handler
void basechanged_event_handler(ViewportData *viewport_data)
{
	Log::message("\Handling BaseChanged event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections basechanged_event_connections;

// link to this instance when subscribing to an event (subscription to various events can be linked)
ViewportData::getEventBaseChanged().connect(basechanged_event_connections, basechanged_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
ViewportData::getEventBaseChanged().connect(basechanged_event_connections, [](ViewportData *viewport_data) { 
		Log::message("\Handling BaseChanged event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
basechanged_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection basechanged_event_connection;

// subscribe to the BaseChanged event with a handler function keeping the connection
ViewportData::getEventBaseChanged().connect(basechanged_event_connection, basechanged_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
basechanged_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
basechanged_event_connection.setEnabled(true);

// ...

// remove subscription to the BaseChanged event via the connection
basechanged_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A BaseChanged event handler implemented as a class member
	void event_handler(ViewportData *viewport_data)
	{
		Log::message("\Handling BaseChanged event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
ViewportData::getEventBaseChanged().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;


//////////////////////////////////////////////////////////////////////////////
//   4. Subscribe to an event saving a particular connection ID
//   and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////
// instance of the EventConnections class to manage event connections
EventConnections e_connections;

// define a particular connection ID to be used to unsubscribe later
EventConnectionId basechanged_handler_id;

// subscribe to the BaseChanged event with a lambda handler function and keeping connection ID
basechanged_handler_id = ViewportData::getEventBaseChanged().connect(e_connections, [](ViewportData *viewport_data) { 
		Log::message("\Handling BaseChanged event (lambda).\n");
	}
);

// remove the subscription later using the ID
ViewportData::getEventBaseChanged().disconnect(basechanged_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   5. Ignoring all BaseChanged events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
ViewportData::getEventBaseChanged().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
ViewportData::getEventBaseChanged().setEnabled(true);

Return value

Event reference.

static Event<ViewportData*> getEventWarpChanged() const#

event triggered on changing warping (geometry correction). You can subscribe to events via connect()   and unsubscribe via disconnect(). You can also use EventConnection and EventConnections classes for convenience (see examples below).
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(ViewportData *viewport_data)

Usage Example

Source code (C++)
// implement the WarpChanged event handler
void warpchanged_event_handler(ViewportData *viewport_data)
{
	Log::message("\Handling WarpChanged event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections warpchanged_event_connections;

// link to this instance when subscribing to an event (subscription to various events can be linked)
ViewportData::getEventWarpChanged().connect(warpchanged_event_connections, warpchanged_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
ViewportData::getEventWarpChanged().connect(warpchanged_event_connections, [](ViewportData *viewport_data) { 
		Log::message("\Handling WarpChanged event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
warpchanged_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection warpchanged_event_connection;

// subscribe to the WarpChanged event with a handler function keeping the connection
ViewportData::getEventWarpChanged().connect(warpchanged_event_connection, warpchanged_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
warpchanged_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
warpchanged_event_connection.setEnabled(true);

// ...

// remove subscription to the WarpChanged event via the connection
warpchanged_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A WarpChanged event handler implemented as a class member
	void event_handler(ViewportData *viewport_data)
	{
		Log::message("\Handling WarpChanged event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
ViewportData::getEventWarpChanged().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;


//////////////////////////////////////////////////////////////////////////////
//   4. Subscribe to an event saving a particular connection ID
//   and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////
// instance of the EventConnections class to manage event connections
EventConnections e_connections;

// define a particular connection ID to be used to unsubscribe later
EventConnectionId warpchanged_handler_id;

// subscribe to the WarpChanged event with a lambda handler function and keeping connection ID
warpchanged_handler_id = ViewportData::getEventWarpChanged().connect(e_connections, [](ViewportData *viewport_data) { 
		Log::message("\Handling WarpChanged event (lambda).\n");
	}
);

// remove the subscription later using the ID
ViewportData::getEventWarpChanged().disconnect(warpchanged_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   5. Ignoring all WarpChanged events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
ViewportData::getEventWarpChanged().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
ViewportData::getEventWarpChanged().setEnabled(true);

Return value

Event reference.

static Event<ViewportData*> getEventEasyblendChanged() const#

event triggered on loading or unloading a multi-projector setup configuration .ol-file (created via Scalable Display Manager). You can subscribe to events via connect()   and unsubscribe via disconnect(). You can also use EventConnection and EventConnections classes for convenience (see examples below).
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(ViewportData *viewport_data)

Usage Example

Source code (C++)
// implement the EasyblendChanged event handler
void easyblendchanged_event_handler(ViewportData *viewport_data)
{
	Log::message("\Handling EasyblendChanged event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections easyblendchanged_event_connections;

// link to this instance when subscribing to an event (subscription to various events can be linked)
ViewportData::getEventEasyblendChanged().connect(easyblendchanged_event_connections, easyblendchanged_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
ViewportData::getEventEasyblendChanged().connect(easyblendchanged_event_connections, [](ViewportData *viewport_data) { 
		Log::message("\Handling EasyblendChanged event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
easyblendchanged_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection easyblendchanged_event_connection;

// subscribe to the EasyblendChanged event with a handler function keeping the connection
ViewportData::getEventEasyblendChanged().connect(easyblendchanged_event_connection, easyblendchanged_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
easyblendchanged_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
easyblendchanged_event_connection.setEnabled(true);

// ...

// remove subscription to the EasyblendChanged event via the connection
easyblendchanged_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A EasyblendChanged event handler implemented as a class member
	void event_handler(ViewportData *viewport_data)
	{
		Log::message("\Handling EasyblendChanged event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
ViewportData::getEventEasyblendChanged().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;


//////////////////////////////////////////////////////////////////////////////
//   4. Subscribe to an event saving a particular connection ID
//   and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////
// instance of the EventConnections class to manage event connections
EventConnections e_connections;

// define a particular connection ID to be used to unsubscribe later
EventConnectionId easyblendchanged_handler_id;

// subscribe to the EasyblendChanged event with a lambda handler function and keeping connection ID
easyblendchanged_handler_id = ViewportData::getEventEasyblendChanged().connect(e_connections, [](ViewportData *viewport_data) { 
		Log::message("\Handling EasyblendChanged event (lambda).\n");
	}
);

// remove the subscription later using the ID
ViewportData::getEventEasyblendChanged().disconnect(easyblendchanged_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   5. Ignoring all EasyblendChanged events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
ViewportData::getEventEasyblendChanged().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
ViewportData::getEventEasyblendChanged().setEnabled(true);

Return value

Event reference.

static Event<ViewportData*> getEventBlendChanged() const#

event triggered on changing screen-space or edge blending settings (alpha, contrast, gamma, etc.). You can subscribe to events via connect()   and unsubscribe via disconnect(). You can also use EventConnection and EventConnections classes for convenience (see examples below).
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(ViewportData *viewport_data)

Usage Example

Source code (C++)
// implement the BlendChanged event handler
void blendchanged_event_handler(ViewportData *viewport_data)
{
	Log::message("\Handling BlendChanged event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections blendchanged_event_connections;

// link to this instance when subscribing to an event (subscription to various events can be linked)
ViewportData::getEventBlendChanged().connect(blendchanged_event_connections, blendchanged_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
ViewportData::getEventBlendChanged().connect(blendchanged_event_connections, [](ViewportData *viewport_data) { 
		Log::message("\Handling BlendChanged event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
blendchanged_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection blendchanged_event_connection;

// subscribe to the BlendChanged event with a handler function keeping the connection
ViewportData::getEventBlendChanged().connect(blendchanged_event_connection, blendchanged_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
blendchanged_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
blendchanged_event_connection.setEnabled(true);

// ...

// remove subscription to the BlendChanged event via the connection
blendchanged_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A BlendChanged event handler implemented as a class member
	void event_handler(ViewportData *viewport_data)
	{
		Log::message("\Handling BlendChanged event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
ViewportData::getEventBlendChanged().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;


//////////////////////////////////////////////////////////////////////////////
//   4. Subscribe to an event saving a particular connection ID
//   and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////
// instance of the EventConnections class to manage event connections
EventConnections e_connections;

// define a particular connection ID to be used to unsubscribe later
EventConnectionId blendchanged_handler_id;

// subscribe to the BlendChanged event with a lambda handler function and keeping connection ID
blendchanged_handler_id = ViewportData::getEventBlendChanged().connect(e_connections, [](ViewportData *viewport_data) { 
		Log::message("\Handling BlendChanged event (lambda).\n");
	}
);

// remove the subscription later using the ID
ViewportData::getEventBlendChanged().disconnect(blendchanged_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   5. Ignoring all BlendChanged events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
ViewportData::getEventBlendChanged().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
ViewportData::getEventBlendChanged().setEnabled(true);

Return value

Event reference.

static Event<ViewportData*> getEventMaskChanged() const#

event triggered on changing (adding, removing, or modifying) masks. You can subscribe to events via connect()   and unsubscribe via disconnect(). You can also use EventConnection and EventConnections classes for convenience (see examples below).
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(ViewportData *viewport_data)

Usage Example

Source code (C++)
// implement the MaskChanged event handler
void maskchanged_event_handler(ViewportData *viewport_data)
{
	Log::message("\Handling MaskChanged event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections maskchanged_event_connections;

// link to this instance when subscribing to an event (subscription to various events can be linked)
ViewportData::getEventMaskChanged().connect(maskchanged_event_connections, maskchanged_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
ViewportData::getEventMaskChanged().connect(maskchanged_event_connections, [](ViewportData *viewport_data) { 
		Log::message("\Handling MaskChanged event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
maskchanged_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection maskchanged_event_connection;

// subscribe to the MaskChanged event with a handler function keeping the connection
ViewportData::getEventMaskChanged().connect(maskchanged_event_connection, maskchanged_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
maskchanged_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
maskchanged_event_connection.setEnabled(true);

// ...

// remove subscription to the MaskChanged event via the connection
maskchanged_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A MaskChanged event handler implemented as a class member
	void event_handler(ViewportData *viewport_data)
	{
		Log::message("\Handling MaskChanged event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
ViewportData::getEventMaskChanged().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;


//////////////////////////////////////////////////////////////////////////////
//   4. Subscribe to an event saving a particular connection ID
//   and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////
// instance of the EventConnections class to manage event connections
EventConnections e_connections;

// define a particular connection ID to be used to unsubscribe later
EventConnectionId maskchanged_handler_id;

// subscribe to the MaskChanged event with a lambda handler function and keeping connection ID
maskchanged_handler_id = ViewportData::getEventMaskChanged().connect(e_connections, [](ViewportData *viewport_data) { 
		Log::message("\Handling MaskChanged event (lambda).\n");
	}
);

// remove the subscription later using the ID
ViewportData::getEventMaskChanged().disconnect(maskchanged_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   5. Ignoring all MaskChanged events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
ViewportData::getEventMaskChanged().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
ViewportData::getEventMaskChanged().setEnabled(true);

Return value

Event reference.

static Event<ViewportData*> getEventColorChanged() const#

event triggered on changing brightness and color correction settings. You can subscribe to events via connect()   and unsubscribe via disconnect(). You can also use EventConnection and EventConnections classes for convenience (see examples below).
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(ViewportData *viewport_data)

Usage Example

Source code (C++)
// implement the ColorChanged event handler
void colorchanged_event_handler(ViewportData *viewport_data)
{
	Log::message("\Handling ColorChanged event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections colorchanged_event_connections;

// link to this instance when subscribing to an event (subscription to various events can be linked)
ViewportData::getEventColorChanged().connect(colorchanged_event_connections, colorchanged_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
ViewportData::getEventColorChanged().connect(colorchanged_event_connections, [](ViewportData *viewport_data) { 
		Log::message("\Handling ColorChanged event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
colorchanged_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection colorchanged_event_connection;

// subscribe to the ColorChanged event with a handler function keeping the connection
ViewportData::getEventColorChanged().connect(colorchanged_event_connection, colorchanged_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
colorchanged_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
colorchanged_event_connection.setEnabled(true);

// ...

// remove subscription to the ColorChanged event via the connection
colorchanged_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A ColorChanged event handler implemented as a class member
	void event_handler(ViewportData *viewport_data)
	{
		Log::message("\Handling ColorChanged event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
ViewportData::getEventColorChanged().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;


//////////////////////////////////////////////////////////////////////////////
//   4. Subscribe to an event saving a particular connection ID
//   and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////
// instance of the EventConnections class to manage event connections
EventConnections e_connections;

// define a particular connection ID to be used to unsubscribe later
EventConnectionId colorchanged_handler_id;

// subscribe to the ColorChanged event with a lambda handler function and keeping connection ID
colorchanged_handler_id = ViewportData::getEventColorChanged().connect(e_connections, [](ViewportData *viewport_data) { 
		Log::message("\Handling ColorChanged event (lambda).\n");
	}
);

// remove the subscription later using the ID
ViewportData::getEventColorChanged().disconnect(colorchanged_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   5. Ignoring all ColorChanged events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
ViewportData::getEventColorChanged().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
ViewportData::getEventColorChanged().setEnabled(true);

Return value

Event reference.

static Event<ViewportData*> getEventDebugChanged() const#

event triggered on changing auxiliary debug settings. You can subscribe to events via connect()   and unsubscribe via disconnect(). You can also use EventConnection and EventConnections classes for convenience (see examples below).
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(ViewportData *viewport_data)

Usage Example

Source code (C++)
// implement the DebugChanged event handler
void debugchanged_event_handler(ViewportData *viewport_data)
{
	Log::message("\Handling DebugChanged event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections debugchanged_event_connections;

// link to this instance when subscribing to an event (subscription to various events can be linked)
ViewportData::getEventDebugChanged().connect(debugchanged_event_connections, debugchanged_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
ViewportData::getEventDebugChanged().connect(debugchanged_event_connections, [](ViewportData *viewport_data) { 
		Log::message("\Handling DebugChanged event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
debugchanged_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection debugchanged_event_connection;

// subscribe to the DebugChanged event with a handler function keeping the connection
ViewportData::getEventDebugChanged().connect(debugchanged_event_connection, debugchanged_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
debugchanged_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
debugchanged_event_connection.setEnabled(true);

// ...

// remove subscription to the DebugChanged event via the connection
debugchanged_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A DebugChanged event handler implemented as a class member
	void event_handler(ViewportData *viewport_data)
	{
		Log::message("\Handling DebugChanged event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
ViewportData::getEventDebugChanged().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;


//////////////////////////////////////////////////////////////////////////////
//   4. Subscribe to an event saving a particular connection ID
//   and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////
// instance of the EventConnections class to manage event connections
EventConnections e_connections;

// define a particular connection ID to be used to unsubscribe later
EventConnectionId debugchanged_handler_id;

// subscribe to the DebugChanged event with a lambda handler function and keeping connection ID
debugchanged_handler_id = ViewportData::getEventDebugChanged().connect(e_connections, [](ViewportData *viewport_data) { 
		Log::message("\Handling DebugChanged event (lambda).\n");
	}
);

// remove the subscription later using the ID
ViewportData::getEventDebugChanged().disconnect(debugchanged_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   5. Ignoring all DebugChanged events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
ViewportData::getEventDebugChanged().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
ViewportData::getEventDebugChanged().setEnabled(true);

Return value

Event reference.

static Event<ViewportData*> getEventSomethingChanged() const#

event triggered on ANY changes in viewport configuration data (warping, blending, color correction, debug, etc.).
Notice
This event is triggered along with all other events of this class.
You can subscribe to events via connect()   and unsubscribe via disconnect(). You can also use EventConnection and EventConnections classes for convenience (see examples below).
Notice
For more details see the Event Handling article.
The event handler signature is as follows: myhandler(ViewportData *viewport_data)

Usage Example

Source code (C++)
// implement the SomethingChanged event handler
void somethingchanged_event_handler(ViewportData *viewport_data)
{
	Log::message("\Handling SomethingChanged event\n");
}


//////////////////////////////////////////////////////////////////////////////
//  1. Multiple subscriptions can be linked to an instance of the EventConnections 
//  class that you can use later to remove all these subscriptions at once
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnections class
EventConnections somethingchanged_event_connections;

// link to this instance when subscribing to an event (subscription to various events can be linked)
ViewportData::getEventSomethingChanged().connect(somethingchanged_event_connections, somethingchanged_event_handler);

// other subscriptions are also linked to this EventConnections instance 
// (e.g. you can subscribe using lambdas)
ViewportData::getEventSomethingChanged().connect(somethingchanged_event_connections, [](ViewportData *viewport_data) { 
		Log::message("\Handling SomethingChanged event (lambda).\n");
	}
);

// ...

// later all of these linked subscriptions can be removed with a single line
somethingchanged_event_connections.disconnectAll();

//////////////////////////////////////////////////////////////////////////////
//  2. You can subscribe and unsubscribe via an instance of the EventConnection 
//  class. And toggle this particular connection off and on, when necessary.
//////////////////////////////////////////////////////////////////////////////

// create an instance of the EventConnection class
EventConnection somethingchanged_event_connection;

// subscribe to the SomethingChanged event with a handler function keeping the connection
ViewportData::getEventSomethingChanged().connect(somethingchanged_event_connection, somethingchanged_event_handler);

// ...

// you can temporarily disable a particular event connection to perform certain actions
somethingchanged_event_connection.setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
somethingchanged_event_connection.setEnabled(true);

// ...

// remove subscription to the SomethingChanged event via the connection
somethingchanged_event_connection.disconnect();

//////////////////////////////////////////////////////////////////////////////
//  3. You can add EventConnection/EventConnections instance as a member of the
//  class that handles the event. In this case all linked subscriptions will be 
//  automatically removed when class destructor is called
//////////////////////////////////////////////////////////////////////////////

// Class handling the event
class SomeClass
{
public:
	// instance of the EventConnections class as a class member
	EventConnections e_connections;

	// A SomethingChanged event handler implemented as a class member
	void event_handler(ViewportData *viewport_data)
	{
		Log::message("\Handling SomethingChanged event\n");
		// ...
	}
};

SomeClass *sc = new SomeClass();

// ...

// specify a class instance in case a handler method belongs to some class
ViewportData::getEventSomethingChanged().connect(sc->e_connections, sc, &SomeClass::event_handler);

// ...

// handler class instance is deleted with all its subscriptions removed automatically
delete sc;


//////////////////////////////////////////////////////////////////////////////
//   4. Subscribe to an event saving a particular connection ID
//   and unsubscribe later by this ID
//////////////////////////////////////////////////////////////////////////////
// instance of the EventConnections class to manage event connections
EventConnections e_connections;

// define a particular connection ID to be used to unsubscribe later
EventConnectionId somethingchanged_handler_id;

// subscribe to the SomethingChanged event with a lambda handler function and keeping connection ID
somethingchanged_handler_id = ViewportData::getEventSomethingChanged().connect(e_connections, [](ViewportData *viewport_data) { 
		Log::message("\Handling SomethingChanged event (lambda).\n");
	}
);

// remove the subscription later using the ID
ViewportData::getEventSomethingChanged().disconnect(somethingchanged_handler_id);


//////////////////////////////////////////////////////////////////////////////
//   5. Ignoring all SomethingChanged events when necessary
//////////////////////////////////////////////////////////////////////////////

// you can temporarily disable the event to perform certain actions without triggering it
ViewportData::getEventSomethingChanged().setEnabled(false);

// ... actions to be performed

// and enable it back when necessary
ViewportData::getEventSomethingChanged().setEnabled(true);

Return value

Event reference.

void update ( ) #

Updates the data displayed in the viewport.

void grabWindowParameters ( ) #

Updates the viewport data according to the current window parameters: display index, window size and position.

bool isGrouped ( ) const#

Returns the value specifying if the viewport is in the group.

Return value

true if the viewport is a part of a group, otherwise false.

void loadEasyBlendSettings ( const char * filepath ) #

Loads the settings from the EasyBlend setup file.

Arguments

  • const char * filepath - Path to the EasyBlend setup file.

void removeEasyblendSetup ( ) #

Removes the EasyBlend setup.

WarpGridData * getWarpGrid ( ) #

Returns the warp grid data.

Return value

WarpGridData class instance that stores the warp grid data.

BlendZonesData * getBlendZones ( ) #

Returns the blend zones data.

Return value

BlendZonesData class instance that stores the blend zones data.

MasksData * getMasks ( ) #

Returns the masks data.

Return value

MasksData class instance that stores the masks data.

ColorCorrectionData * getColorCorrection ( ) #

Returns the color correction data.

Return value

ColorCorrectionData class instance that stores the color correction data.

DebugData * getDebug ( ) #

Returns the debug data.

Return value

DebugData class instance that stores the debug data.

EasyBlendData * getEasyblendData ( ) #

Returns the EasyBlend data.

Return value

EasyBlendData class instance that stores the EasyBlend data.

void saveXml ( const Ptr<Xml> & xml ) #

Saves the viewport data to the given instance of the Xml class.

Arguments

  • const Ptr<Xml> & xml - Xml class instance into which the data will be saved.

bool restoreXml ( const Ptr<Xml> & xml ) #

Loads the viewport data from the specified instance of the Xml class.

Arguments

  • const Ptr<Xml> & xml - Xml class instance the data from which is to be loaded.

Return value

true if the data has been loaded successfully, otherwise false.

void save ( const Ptr<Stream> & stream ) #

Saves the viewport data to the specified stream.

Arguments

  • const Ptr<Stream> & stream - Stream to which the data is to be written.

void restore ( const Ptr<Stream> & stream ) #

Loads the viewport data from the specified stream.

Arguments

  • const Ptr<Stream> & stream - Stream the data from which is to be loaded.

void copy ( const ViewportData & data ) #

Copies the current viewport data to the specified instance of the ViewportData class.

Arguments

  • const ViewportData & data - Viewport data.
Last update: 2024-10-17
Build: ()