///////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2002-2025, Open Design Alliance (the "Alliance").
// All rights reserved.
//
// This software and its documentation and related materials are owned by
// the Alliance. The software may only be incorporated into application
// programs owned by members of the Alliance, subject to a signed
// Membership Agreement and Supplemental Software License Agreement with the
// Alliance. The structure and organization of this software are the valuable
// trade secrets of the Alliance and its suppliers. The software is also
// protected by copyright law and international treaty provisions. Application
// programs incorporating this software must include the following statement
// with their copyright notices:
//
// This application incorporates Open Design Alliance software pursuant to a license
// agreement with Open Design Alliance.
// Open Design Alliance Copyright (C) 2002-2025 by Open Design Alliance.
// All rights reserved.
//
// By use of this software, its documentation or related materials, you
// acknowledge and accept the above terms.
///////////////////////////////////////////////////////////////////////////////
#ifndef _ODTV_GSVIEW_H_INCLUDED_
#define _ODTV_GSVIEW_H_INCLUDED_
#include "Tv.h"
#include "TvIObject.h"
#include "TvModel.h"
#include "Ge/GeBoundBlock3d.h"
#include "TvUserData.h"
#include "TvSelection.h"
#include "TvRayTrace.h"
#include "TvVisualStyle.h"
#include "UInt32Array.h"
#include "TvGsViewBackground.h"
#include "TvCollidedResult.h"
#include "Gi/GiRasterImage.h"
#include "Tv3DClipBoundary.h"
#include "TvRtRenderSettings.h"
class OdTvGsDeviceId;
class OdTvGsViewId;
/** \details
This class is an interface class for the object that encapsulates a view object in GUI display windows.
\remarks
Each view object consists of a collection of objects to be viewed and camera parameters that define the view.
\sa
*/
class ODTV_EXPORT OdTvGsView : public OdTvHandledIObject
{
public:
/** \details
Rendering modes.
\sa
Managing Render Modes
*/
enum RenderMode
{
k2DOptimized = 0, // Standard display. Optimized for 2D.
kWireframe = 1, // Standard display. Uses 3D pipeline.
kHiddenLine = 2, // Wireframe display. Hidden lines removed.
kFlatShaded = 3, // Faceted display. One color per face.
kGouraudShaded = 4, // Smooth shaded display. Colors interpolated between vertices.
kFlatShadedWithWireframe = 5, // Faceted display with wireframe overlay.
kGouraudShadedWithWireframe = 6, // Smooth shaded display with wireframe overlay.
kNone // No rendering.
};
/** \details
Projection types.
\sa
Managing Projections
*/
enum Projection
{
kParallel = 0, //Parallel projection.
kPerspective = 1 //Perspective projection.
};
/** \details
Lineweight modes.
\sa
Managing Lineweight Display
*/
enum LineWeightMode
{
kDeviceFixed = 0, //Device fixed mode.
kWorldFixed = 1, //World fixed mode.
kIndexed = 2 //Indexed lineweight mode.
};
/** \details
Lighting types.
\sa
Managing View Lighting
*/
enum DefaultLightingType
{
kOneLight = 0, //One light mode.
kTwoLights, //Two lights mode.
kBackLight, //Back light.
kUserDefined //User defined light.
};
/** \details
Cutting plane filling style.
\sa
*/
enum CuttingPlaneFillStyle
{
kSolid = 0, // Solid filling style
kCheckerboard = 1, // Checkerboard filling style
kCrosshatch = 2, // Crosshatch filling style
kDiamonds = 3, // Diamonds filling style
kHorizontalBars = 4, // Horizontal bars filling style
kSlantLeft = 5, // Slant left filling style
kSlantRight = 6, // Slant right filling style
kSquareDots = 7, // Square dots filling style
kVerticalBars = 8, // Vertical bars filling style
};
/** \details
The structure for storing viewport parameters.
\sa
Managing Viewports
*/
struct ViewportObjectInfo
{
OdTvPoint2d m_wcsLowerLeft; //WCS lower-left point of the viewport.
OdTvPoint2d m_wcsUpperRight; //WCS upper-right point of the viewport.
OdUInt32Array m_numPtsInContours; //A quantity of points in contours.
OdTvPoint2dArray m_wcsCountoursPts; //An array of points that form contours.
/** \details
Creates an instance of default viewport parameters.
\sa
Managing Viewports
*/
ViewportObjectInfo() {};
};
/** \details
Retrieves the object that is associated with the view object.
\param rc [out] A pointer to a value of type that contains the result of the retrieve operation.
\returns An identifier of the device associated with the view object.
\remarks
If the rc parameter is not null and the GS device identifier was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
*/
virtual OdTvGsDeviceId device(OdTvResult* rc = NULL) const = 0;
/** \details
Sets the size and position of the view object.
\param lowerLeft [in] A point that represents the lower-left corner in normalized device coordinates ([0.0 .. 1.0]).
\param upperRight [in] A point that represents the upper-right corner in normalized device coordinates ([0.0 .. 1.0]).
\returns A value of type that contains the result of the operation.
\remarks
The point with coordinates (0,0) is the lower-left corner of the device object that owns the view. Coordinates increase upward and to the right.
The view object can be allocated partly or completely off the screen.
If the size and position of the view were successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Viewports
*/
virtual OdTvResult setViewport(const OdTvPoint2d& lowerLeft, const OdTvPoint2d& upperRight) = 0;
/** \details
Sets the size and position of the view object.
\param screenRect [in] A screen rectangle in the device coordinates (pixels).
\returns A value of type that contains the result of the operation.
\remarks
The point with coordinates (0,0) is the lower-left corner of the device object that owns the view. Coordinates increase upward and to the right.
The view object can be allocated partly or completely off the screen.
If the size and position of the view were successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Viewports
*/
virtual OdTvResult setViewport(const OdTvDCRect& screenRect) = 0;
/** \details
Retrieves the current size and position of the view object.
\param lowerLeft [out] A placeholder for the point that represents the lower-left corner in normalized device coordinates ([0.0 .. 1.0]).
\param upperRight [out] A placeholder for the point that represents the upper-right corner in normalized device coordinates ([0.0 .. 1.0]).
\returns A value of type that contains the result of the retrieve operation.
\remarks
The point with coordinates (0,0) is the lower-left corner of the device object that owns the view. Coordinates increase upward and to the right.
The view object can be allocated partly or completely off the screen.
If the size and position of the view were successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Viewports
*/
virtual OdTvResult getViewport(OdTvPoint2d& lowerLeft, OdTvPoint2d& upperRight) const = 0;
/** \details
Retrieves the size and position of the view object.
\param screenRect [out] A placeholder for the screen rectangle object that represents the position and size of the view in the device coordinates (pixels).
\returns A value of type that contains the result of the retrieve operation.
\remarks
The point with coordinates (0,0) is the lower-left corner of the device object that owns the view. Coordinates increase upward and to the right.
The view object can be allocated partly or completely off the screen.
If the rectangle object that represents the size and position of the view was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Viewports
*/
virtual OdTvResult getViewport(OdTvDCRect& screenRect) const = 0;
/** \details
Sets new camera parameters for the view object.
\param position [in] A new camera position.
\param target [in] A new camera target.
\param upVector [in] A new camera up vector.
\param fieldWidth [in] A new projection plane (field) width.
\param fieldHeight [in] A new projection plane (field) height.
\param projectionType [in] A new projection type.
\returns A value of type that contains the result of the operation.
\remarks
All parameters are represented in WCS coordinates.
The projectionType parameter must accept one of the following values:
Name Value
kParallel 0
kPerspective 1
The method defines a transformation from WCS coordinates to normalized device coordinates.
If new view camera parameters were successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
In perspective mode, Pair<fieldWidth, fieldHeight> and Position are co-dependent parameters, so they may conflict if the lens length is fixed.
If such conflict happens Position will be used to define viewing direction only, to keep specified fieldWidth and fieldHeight unchanged.
However, method adjusts the lens length so both actual Pair<fieldWidth, fieldHeight> and Position are the same as the provided parameters.
\sa
Managing Camera Parameters
*/
virtual OdTvResult setView(
const OdTvPoint& position,
const OdTvPoint& target,
const OdTvVector& upVector,
double fieldWidth,
double fieldHeight,
Projection projectionType = kParallel) = 0;
/** \details
Retrieves the current camera position for the view object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns A point object that represents the camera position for the view object in WCS coordinates.
\remarks
If the rc parameter is not null and the view camera position was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Camera Parameters
*/
virtual OdTvPoint position(OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves the current camera target for the view object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns A point object that represents the camera target for the view object in WCS coordinates.
\remarks
If the rc parameter is not null and the view camera target was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Camera Parameters
*/
virtual OdTvPoint target(OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves the current camera's up vector for the view object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns A vector object that represents the camera's up vector for the view object.
\remarks
If the rc parameter is not null and the view camera's up vector was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Camera Parameters
*/
virtual OdTvVector upVector(OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves the current camera perspective lens length for the view object.
\returns A double value that represents the camera perspective lens length for the view object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\remarks
If the rc parameter is not null and the camera perspective lens length was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Projections
*/
virtual double lensLength(OdTvResult* rc = NULL) const = 0;
/** \details
Sets the perspective lens length for the view object.
\param lensLength [in] A new value of the perspective lens length.
\returns A value of type that contains the result of the operation.
\remarks
If the new lens length was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Projections
*/
virtual OdTvResult setLensLength(double lensLength) = 0;
/** \details
Retrieves the current value of the perspective projection flag for the view object.
The perspective projection flag is equal to true if the projection type is perspective; otherwise it is equal to false.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The current value of the perspective projection.
\remarks
If the rc parameter is not null and the perspective projection flag value was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Projections
*/
virtual bool isPerspective(OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves the current field width of the WCS projection plane for the view object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The current WCS projection plane (field) width for the view object.
\remarks
If the rc parameter is not null and the width of the projection plane field was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Camera Parameters
*/
virtual double fieldWidth(OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves the current field height of the WCS projection plane for the view object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The current WCS projection plane (field) height for the view object.
\remarks
If the rc parameter is not null and the height of the projection plane field was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Camera Parameters
*/
virtual double fieldHeight(OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves the focal length of this view object.
\param rc [out] [out] A pointer to a value of type that contains the result of the operation.
\returns The focal length of this view object.
\remarks
This method does not apply to the parallel view object, and in this case, the return value is 0 and the rc value is tvWarning.
*/
virtual double focalLength( OdTvResult* rc = NULL ) const = 0;
/** \details
Retrieves the current extents of the eye coordinate system for the view object.
\param extents [out] A placeholder for the extents object. The method fills a passed object and returns it to a calling subroutine.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns true if the extents are defined and the view of the device has an appropriate method; otherwise returns false.
\remarks
If the rc parameter is not null and the extents object was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
*/
virtual bool viewExtents(OdGeBoundBlock3d& extents, OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves the current matrix for transformation from world space to view space.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The matrix that transforms world space to view space.
\remarks
If the rc parameter is not null and the transformation matrix was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
*/
virtual OdGeMatrix3d viewingMatrix(OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves the current matrix that transforms view space to the normalized device space associated with the view object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The matrix that transforms view space to normalized device space.
\remarks
If the rc parameter is not null and the transformation matrix was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Coordinate Systems.
*/
virtual OdGeMatrix3d projectionMatrix(OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves the current matrix that transforms the normalized device space associated with the view object to screen space.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The matrix that transforms the normalized device space of the view to screen space.
\remarks
If the rc parameter is not null and the transformation matrix was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Coordinate Systems.
*/
virtual OdGeMatrix3d screenMatrix(OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves the current matrix that transforms coordinates from world space to the screen space for the view object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The matrix that transforms coordinates from world space to screen space.
\remarks
If the rc parameter is not null and the transformation matrix was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
The method returns the transformation matrix that is equal to the concatenation of matrices, which are returned by ,
and methods.
\sa
Coordinate Systems.
*/
virtual OdGeMatrix3d worldToDeviceMatrix(OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves the current matrix that transforms view space to world space for the view object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The matrix that transforms coordinates from view space to world space.
\remarks
If the rc parameter is not null and the transformation matrix was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Coordinate Systems.
*/
virtual OdGeMatrix3d eyeToWorldMatrix(OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves the current lower-left and upper-right corners of the view object in the associated device coordinates.
\param lower_left [out] A placeholder for a point object that represents the lower-left corner of the view object.
\param upper_right [out] A placeholder for a point object that represents the upper-right corner of the view object.
\returns A value of the type that contains the result of retrieving the view corners.
\remarks
If the view corners points were successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code.
*/
virtual OdTvResult viewDcCorners(OdGePoint2d& lower_left, OdGePoint2d& upper_right) const = 0;
/** \details
Sets a new render mode for the view object.
\param mode [in] A new render mode value.
\returns A value of the type that contains the result of setting a new render mode operation.
\remarks
The render mode input parameter accepts one of the following values:
Name Value Description
k2DOptimized 0 Standard display. Optimized for 2D.
kWireframe 1 Standard display. Uses 3D pipeline.
kHiddenLine 2 Wireframe display. Hidden lines removed.
kFlatShaded 3 Faceted display. One color per face.
kGouraudShaded 4 Smooth shaded display. Colors interpolated between vertices.
kFlatShadedWithWireframe 5 Faceted display with wireframe overlay.
kGouraudShadedWithWireframe 6 Smooth shaded display with wireframe overlay.
If the new render mode value was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Render Modes
*/
virtual OdTvResult setMode(RenderMode mode) = 0;
/** \details
Retrieves the current render mode for the view object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The current render mode value.
\remarks
The method returns one of the following values:
Name Value Description
k2DOptimized 0 Standard display. Optimized for 2D.
kWireframe 1 Standard display. Uses 3D pipeline.
kHiddenLine 2 Wireframe display. Hidden lines removed.
kFlatShaded 3 Faceted display. One color per face.
kGouraudShaded 4 Smooth shaded display. Colors interpolated between vertices.
kFlatShadedWithWireframe 5 Faceted display with wireframe overlay.
kGouraudShadedWithWireframe 6 Smooth shaded display with wireframe overlay.
If the rc parameter is not null and the render mode value was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Render Modes
*/
virtual RenderMode mode(OdTvResult* rc = NULL) const = 0;
/** \details
Adds a specified scene model to the view object.
\param sceneModelId [in] An identifier of a model object to be added.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns true if the specified scene model is added to the view; otherwise returns false.
\remarks
If the rc parameter is not null and a new scene model was successfully added, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Model Collections
*/
virtual bool addModel(const OdTvModelId& sceneModelId, OdTvResult* rc = NULL) = 0;
/** \details
Removes a specified scene model from the view object.
\param sceneModelId [in] ID of the model object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns true if the specified scene model is removed from the view; otherwise returns false.
\remarks
If the rc parameter is not null and a scene model was successfully removed from the view, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Model Collections
*/
virtual bool eraseModel(const OdTvModelId& sceneModelId, OdTvResult* rc = NULL) = 0;
/** \details
Removes all scene models from the view object.
\returns A value of the type that contains the result of the model's remove operation.
\remarks
If all models were successfully removed from the view, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Model Collections
*/
virtual OdTvResult eraseAllModels() = 0;
/** \details
Retrieves the quantity of models associated with the view object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The current quantity of models associated with the view object.
\remarks
If the rc parameter is not null and the quantity of view models was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Model Collections
*/
virtual int numModels(OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves a view model with a specified index.
\param modelIndex [in] A model index.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The identifier of a model object with a specified index. The model is represented with an object.
\remarks
If the rc parameter is not null and the model object was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Model Collections
*/
virtual OdTvModelId modelAt(int modelIndex, OdTvResult* rc = NULL) = 0;
/** \details
Translates the view camera position and target according to a specified direction and distance.
\param dollyVector [in] A camera coordinates dolly vector.
\returns A value of the type that contains the result of the translation operation.
\remarks
Camera coordinates are relative to the view of a target from a camera.
If the translation was successful, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Camera Transformation Actions
*/
virtual OdTvResult dolly(const OdTvVector& dollyVector) = 0;
/** \details
Translates the view camera position and target according to a specified camera coordinates dolly amount.
\param xDolly [in] A camera coordinate X dolly amount.
\param yDolly [in] A camera coordinate Y dolly amount.
\param zDolly [in] A camera coordinate Z dolly amount.
\returns A value of the type that contains the result of the translation operation.
\remarks
Camera coordinates are relative to the view of a target from a camera.
* The Y-axis is along the up vector.
* The Z-axis is along the vector from the camera position to the target.
* The X-axis is the cross product of the Y-axis and the Z-axis.
If the translation was successful, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Camera Transformation Actions
*/
virtual OdTvResult dolly(double xDolly, double yDolly, double zDolly) = 0;
/** \details
Rotates the view camera about the eye vector according to a specified roll angle.
\param rollAngle [in] A camera counterclockwise roll angle.
\returns A value of the type that contains the result of the rotation.
\remarks
A positive angle leads to the camera counterclockwise rotation about the eye vector, when viewed from the camera position to the target.
This corresponds to a clockwise rotation of the up vector.
Camera coordinates are relative to the view of a target from a camera.
* The Y-axis is along the up vector.
* The Z-axis (eye vector) is along the vector from the camera position to the target.
* The X-axis is the cross product of the Y-axis and the Z-axis.
All angles are measured in radians.
If the camera was successfully rotated, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Camera Transformation Actions
*/
virtual OdTvResult roll(double rollAngle) = 0;
/** \details
Orbits the camera around the target according to specified angles.
\param xOrbit [in] An X-axis orbit value.
\param yOrbit [in] A Y-axis orbit value.
\returns A value of the type that contains the result of the operation.
\remarks
The camera moves on the surface of a sphere with a center that is the camera target. The sphere radius is equal to the distance from the camera position to its target.
* First the camera is rotated about an axis parallel to the X-axis and passing through the target.
* Second the camera is rotated about an axis parallel to the Y-axis and passing through the target.
The camera coordinates are relative to the view of a target from the camera.
* The Y-axis is along the up vector.
* The Z-axis (eye vector) is along the vector from the camera position to the target.
* The X-axis is the cross product of the Y-axis and the Z-axis.
All angles are measured in radians.
If the orbit operation was successful, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Camera Transformation Actions
*/
virtual OdTvResult orbit(double xOrbit, double yOrbit) = 0;
/** \details
Scales the focal length of the camera according to a specified factor.
\param zoomFactor [in] A zoom factor value.
\returns A value of the type that contains the result of the zoom operation.
\remarks
If the zoom operation was successful, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Camera Transformation Actions
*/
virtual OdTvResult zoom(double zoomFactor) = 0;
/** \details
Rotates the target around the camera according to specified angles.
\param xPan [in] An X-axis pan angle.
\param yPan [in] A Y-axis pan angle.
\returns A value of the type that contains the result of the pan operation.
\remarks
The target moves on the surface a sphere with a center that is the camera position. The sphere radius is equal to the distance from the camera position to its target.
* First the target is rotated about an axis parallel to the X-axis and passing through the camera.
* Second the target is rotated about an axis parallel to the Y-axis and passing through the camera.
The camera coordinates are relative to the view of a target from a camera.
* The Y-axis is along the up vector.
* The Z-axis (eye vector) is along the vector from the camera position to the target.
* The X-axis is the cross product of the Y-axis and the Z-axis.
All angles are measured in radians.
If the pan operation was successful, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Camera Transformation Actions
*/
virtual OdTvResult pan(double xPan, double yPan) = 0;
/** \details
Scales the camera to completely include a specified WCS box inside the view frustum.
\param minPt [in] A minimal WCS box point.
\param maxPt [in] A maximum WCS box point.
\param bCacheIfNonSetup [in] Indicates, that it is need to cache the input extent's parameters if the view is still "non-setup."
\returns A value of the type that contains the result of the scale operation.
\remarks
If the scale operation was successful, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Camera Transformation Actions
*/
virtual OdTvResult zoomExtents(const OdTvPoint &minPt, const OdTvPoint &maxPt, bool bCacheIfNonSetup = false) = 0;
/** \details
Scales the camera to completely include a specified screen area.
\param lowerLeft [in] A point that represents the lower-left corner in normalized device coordinates ([0.0 .. 1.0]).
\param upperRight [in] A point that represents the upper-right corner in normalized device coordinates ([0.0 .. 1.0]).
\returns A value of the type that contains the result of the scale operation.
\remarks
If the scale operation was successful, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Camera Transformation Actions
*/
virtual OdTvResult zoomWindow(const OdGePoint2d &lowerLeft, const OdGePoint2d &upperRight) = 0;
/** \details
Runs the selection procedure inside the view object.
\param pts [in] A pointer to an array of selection points in the device coordinate space (pixels).
\param nPoints [in] A quantity of selection points.
\param options [in] A set of selection options such as mode, level, pick box size.
\param modelId [in] An identifier of a model where the objects should be selected.
\param rc [out] A pointer to a value of type that contains the result of the selection operation.
\returns A smart pointer to the .
\remarks
If the rc parameter is not null and the selection operation was successful, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
*/
virtual OdTvSelectionSetPtr select(const OdTvDCPoint* pts, int nPoints, const OdTvSelectionOptions& options, const OdTvModelId& modelId, OdTvResult* rc = NULL) = 0;
/** \details
Runs ray tracing procedure inside this view object.
\param rayOrigin [in] Origin of tracing ray in WCS.
\param rayDirection [in] Direction of tracing ray in WCS.
\param modelId [in] Model in which we will find the intersections.
\param result[out] Object, which contains the result of operation.
\param bSortedSelection [in] Enables ordered ray tracing instead of random.
\returns A value of the type that contains the result of the tracing procedure.
*/
virtual OdTvResult rayTrace(const OdTvPoint& rayOrigin, const OdTvVector& rayDirection, const OdTvModelId& modelId, OdTvRayTraceResultResult& result, bool bSortedSelection = false) = 0;
/** \details
Runs ray tracing procedure inside this view object.
\param rayOrigin [in] Origin of tracing ray in World Coordinates System.
\param rayDirection [in] Direction of tracing ray in World Coordinates System.
\param inputSet[in] A smart pointer to the set of objects in which we will find the intersections.
\param result[out] Object, which contains the result of operation.
\param bSortedSelection [in] Enables ordered ray tracing instead of random.
\returns A value of the type that contains the result of the tracing procedure.
*/
virtual OdTvResult rayTrace(const OdTvPoint& rayOrigin, const OdTvVector& rayDirection, const OdTvSelectionSetPtr& inputSet, OdTvRayTraceResultResult& result, bool bSortedSelection = false) = 0;
/** \details
Runs the collision detection 'all with all' procedure inside the view object.
\param modelId [in] Model which contains objects to check.
\param collidedWho [out] A smart pointer to the set of objects who collided (first object in the collided pair).
\param collidedWithWhom [out] A smart pointer to the set of objects with whom collided (second object in the collided pair).
\param level [in] The selection level.
\param bIntersectionOnly [in] Consider only intersections (not consider touches like between two sides of cube).
\param tolerance [in] Collision tolerance; used in IntersectionsOnly case.
\returns A value of the type that contains the result of the collision operation.
\remarks
If the collision detection operation was successful, the method returns the tvOk value; otherwise it returns an appropriate error code.
This method should be used when it is need to find all collisions inside the input model. The selection level is need to define the level for the
resulting selection sets. 'collidedWho' and 'collidedWithWhom' sets have equal length.
\sa
*/
virtual OdTvResult collide(const OdTvModelId& modelId, OdTvCollidedResultPtr& collidedWho, OdTvCollidedResultPtr& collidedWithWhom,
OdTvSelectionOptions::Level level = OdTvSelectionOptions::kEntity, bool bIntersectionOnly = true, double tolerance = 1e-10 ) = 0;
/** \details
Runs the collision detection 'a few with all' procedure inside the view object.
\param inputSet [in] A smart pointer to the set of objects to check.
\param modelId [in] Model which contains objects to be checked with.
\param collidedFromInput [out] A smart pointer to the set of objects which are collided (first object in the collided pair). Can be NULL.
\param level [in] The selection level.
\param bIntersectionOnly [in] Consider only intersections (not consider touches like between two sides of cube).
\param tolerance [in] Collision tolerance; used in IntersectionsOnly case.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns A smart pointer to the of colliding objects.
\remarks
If the rc parameter is not null and collision detection operation was successful, the method returns the tvOk value;
otherwise it returns an appropriate error code. This method should be used when it is need to find all collisions between inputSet and all other objects.
The selection level is need to define the level for the resulting selection set(s). The resulting and 'collidedWithWhom' sets have equal length. If the 'collidedFromInput'
is NULL, then it is not need to collect the first objects in colliding pairs.
\sa
*/
virtual OdTvCollidedResultPtr collide(const OdTvSelectionSetPtr& inputSet, const OdTvModelId& modelId, OdTvCollidedResultPtr& collidedFromInput,
OdTvSelectionOptions::Level level = OdTvSelectionOptions::kEntity, bool bIntersectionOnly = true, double tolerance = 1e-10, OdTvResult* rc = NULL) = 0;
/** \details
Runs the collision detection 'a few with a few' procedure inside the view object.
\param inputSet [in] A smart pointer to the set of objects to check.
\param collisionWithSet [in] A smart pointer to the set of possible colliding objects.
\param collidedFromInput [out] A smart pointer to the set of objects which are collided (first object in the collided pair). Can be NULL.
\param level [in] The selection level.
\param bIntersectionOnly [in] Consider only intersections (not consider touches like between two sides of cube).
\param tolerance [in] Collision tolerance; used in IntersectionsOnly case.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns A smart pointer to the of colliding objects.
\remarks
If the rc parameter is not null and collision detection operation was successful, the method returns the tvOk value;
otherwise it returns an appropriate error code. This method should be used when it is need to find all collisions between 'inputSet' and 'collisionWithSet' set.
The selection level is need to define the level for the resulting selection set(s). The resulting and 'collidedFromInput' sets have equal length. If the 'collidedFromInput'
is NULL, then it is not need to collect the first objects in colliding pairs.
\sa
*/
virtual OdTvCollidedResultPtr collide(const OdTvSelectionSetPtr& inputSet, const OdTvSelectionSetPtr& collisionWithSet, OdTvCollidedResultPtr& collidedFromInput,
OdTvSelectionOptions::Level level = OdTvSelectionOptions::kEntity, bool bIntersectionOnly = true, double tolerance = 1e-10, OdTvResult* rc = NULL) = 0;
/** \details
Runs the collision detection 'all with all' procedure inside the view object.
\param modelId [in] Model which contains objects to check.
\param result [out] A reference for the OdTvCollidedPairResult instance to store result.
\param options [in] Collision detection options.
\returns A value of the type that contains the result of the collision operation.
\remarks
If the collision detection operation is successful, the method returns the tvOk value; otherwise it returns an appropriate error code.
This method finds all collisions inside the input model.
\sa
*/
virtual OdTvResult collide( const OdTvModelId& modelId, OdTvCollidedPairResult& result, const OdTvCollisionOptions& options = OdTvCollisionOptions() ) = 0;
/** \details
Runs the collision detection 'a few with a few' procedure inside the view object.
\param inputSet [in] A smart pointer to the set of objects to check.
\param collisionWithSet [in] A smart pointer to the set of possible colliding objects.
\param result [out] A reference for the OdTvCollidedPairResult instance to store result.
\param options [in] Collision detection options.
\returns A value of the type that contains the result of the collision operation.
\remarks
If the collision detection operation is successful, the method returns the tvOk value; otherwise it returns an appropriate error code.
This method finds all collisions between 'inputSet' and 'collisionWithSet' set.
\sa
*/
virtual OdTvResult collide( const OdTvSelectionSetPtr& inputSet, const OdTvSelectionSetPtr& collisionWithSet, OdTvCollidedPairResult& result, const OdTvCollisionOptions& options = OdTvCollisionOptions() ) = 0;
/** \details
Runs the collision detection 'a few with all' or 'a few with themselves' procedure inside the view object.
\param inputSet [in] A smart pointer to the set of objects to check.
\param modelId [in] Model which contains objects to be checked with.
\param result [out] A reference for the OdTvCollidedPairResult instance to store result.
\param options [in] Collision detection options.
\returns A value of the type that contains the result of the collision operation.
\remarks
If modelId is valid, method detects collisions between list and all other entities from the model.
If modelId is empty, method detects collisions between entities in list.
If the collision detection operation is successful, the method returns the tvOk value; otherwise it returns an appropriate error code.
This method finds all collisions between 'inputSet' and all other objects or between all objects in 'inputSet'.
\sa
*/
virtual OdTvResult collide( const OdTvSelectionSetPtr& inputSet, const OdTvModelId& modelId, OdTvCollidedPairResult& result, const OdTvCollisionOptions& options = OdTvCollisionOptions() ) = 0;
/** \details
Highlights a given item path.
\param id [in] An identifier of an entity that should be highlighted (or subitems that should be highlighted).
\param path [in] A path to subitems that should be highlighted (subentity, geometry, or subgeometry (face or edge) objects).
\param bDoIt [in] A flag value that determines whether highlighting is enabled (if true) or disabled (if false). This flag can switch the highlighting on or off.
\param highLightStyleId [in] A value that determines an index of highlight style in the array that was set to the device.
\returns A value of the type that contains the result of the highlighting operation.
\remarks
If the highlighting operation was successful, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
*/
virtual OdTvResult highlight(const OdTvEntityId& id, const OdTvSubItemPath& path, bool bDoIt = true, OdUInt16 highLightStyleId = 0) = 0;
/** \details
Retrieves the current visible flag value for a specified point in the view object.
\param pt [in] A point to check for visibility. The point coordinates are in WCS.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns true if the specified point is visible inside the view; otherwise returns false.
\remarks
If the rc parameter is not null and the visibility flag value was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
*/
virtual bool isPointVisibleInView(const OdTvPoint &pt, OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves whether a specified point is inside the view area.
\param screenPoint [in] A point in the device coordinate space.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns true if the specified point is inside the view area; otherwise returns false.
\remarks
If the rc parameter is not null and the operation was successful, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
*/
virtual bool pointInView(const OdTvPoint2d& screenPoint, OdTvResult* rc = NULL) const = 0;
/** \details
Returns the display pixel density at the specified point for this view object.
\param point [in] WCS center of the unit square.
\param pixelDensity [out] Receives the pixel density.
\param bUsePerspective [in] Enable perspective inclusion into pixel density calculation.
\returns A value of the type that contains the result of the operation.
\remarks
Pixel density is measured in pixels per WCS unit.
This function can be used to determine if the geometry generated for an object will
be smaller than the size of a pixel.
*/
virtual OdTvResult getNumPixelsInUnitSquare(const OdTvPoint& point, OdTvPoint2d& pixelDensity, bool bUsePerspective = true) const = 0;
/** \details
Set a new lineweight mode to the view object.
\param lwMode [in] A new lineweight mode value.
\returns A value of the type that contains the result of the operation.
\remarks
If the new lineweight mode value was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Lineweight Display
*/
virtual OdTvResult setLineWeightMode(LineWeightMode lwMode) = 0;
/** \details
Retrieves the current lineweight mode value for the view object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The current lineweight mode represented with a value of the enumeration.
\remarks
If the rc parameter is not null and the lineweight mode value was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Lineweight Display
*/
virtual LineWeightMode getLineWeightMode(OdTvResult* rc = NULL) const = 0;
/** \details
Set a new lineweight scale value to the view object.
\param dScale [in] A new lineweight scale value.
\returns A value of the type that contains the result of the operation.
\remarks
If the new lineweight scale value was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Lineweight Display
*/
virtual OdTvResult setLineWeightScale(double dScale) = 0;
/** \details
Retrieves the current lineweight scale value for the view object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The current lineweight scale value.
\remarks
If the rc parameter is not null and the lineweight scale value was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Lineweight Display
*/
virtual double getLineWeightScale(OdTvResult* rc = NULL) const = 0;
/** \details
Sets a new array of lineweights for the view object.
\param numLineweights [in] A quantity of lineweight values.
\param lineweights [in] A pointer to the lineweight values array.
\param altLineWeights [in] A pointer to the alternative lineweight values array.
\returns A value of the type that contains the result of the operation.
\remarks
If the new array of lineweight values was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
Alternative lineweights has higher priority, so original array will be ignored if both arrays specified.
\sa
Managing Lineweight Display
*/
virtual OdTvResult setLineWeightEnum(int numLineweights, const OdUInt8* lineweights, const OdUInt16* altLineWeights = NULL ) = 0;
/** \details
Regenerates the contents of the view object.
\returns A value of the type that contains the result of the regeneration.
\remarks
If the regeneration was successful, the method returns the tvOk value; otherwise it returns an appropriate error code.
*/
virtual OdTvResult regen() = 0;
/** \details
Enables default lighting for the view object.
\param bEnable [in] A new default lighting flag value. If the flag value is equal to true, the lighting is enabled; otherwise it is disabled.
\param lightType [in] A new default lighting type.
\returns A value of the type that contains the result of the operation.
\remarks
If the lighting flag was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing View Lighting
*/
virtual OdTvResult enableDefaultLighting(bool bEnable, DefaultLightingType lightType = kTwoLights) = 0;
/** \details
Retrieves the current value of the default lighting flag. If the flag is equal to true, the default lighting is enabled; otherwise it is disabled.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns true if the default lighting is enabled; otherwise returns false.
\remarks
If the rc parameter is not null and the current flag value was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing View Lighting
*/
virtual bool defaultLightingEnabled(OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves the default lighting type for the view object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The current default lighting type represented with a value of the enumeration.
\remarks
If the rc parameter is not null and the current default lighting type was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing View Lighting
*/
virtual DefaultLightingType defaultLightingType(OdTvResult* rc = NULL) const = 0;
/** \details
Sets a new ambient light color for the view.
\param color [in] A new ambient light color value.
\returns A value of the type that contains the result of the operation.
\remarks
If the new ambient light color value was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing View Lighting
*/
virtual OdTvResult setAmbientLightColor(const OdTvColorDef& color) = 0;
/** \details
Retrieves the current ambient light color for the view.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The current ambient light color for the view represented with an object.
\remarks
If the rc parameter is not null and the current ambient light color value was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing View Lighting
*/
virtual OdTvColorDef getAmbientLightColor(OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves the current direction of the default user-defined light.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns A object that represents the direction of the default user-defined light.
\remarks
If the rc parameter is not null and the current user-defined light direction was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing View Lighting
*/
virtual OdTvVector userDefinedLightDirection(OdTvResult* rc = NULL) const = 0;
/** \details
Sets a new direction of the default user-defined light.
\param lightDirection [in] A object that represents the new direction of the default user-defined light.
\returns A value of the type that contains the result of the operation.
\remarks
If the new light direction was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing View Lighting
*/
virtual OdTvResult setUserDefinedLightDirection(const OdTvVector& lightDirection) = 0;
/** \details
Retrieves the current intensity of the default light.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns A double value that represents the current default light intensity.
\remarks
If the rc parameter is not null and the current default light intensity was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing View Lighting
*/
virtual double defaultLightingIntensity(OdTvResult* rc = NULL) const = 0;
/** \details
Sets a new default light intensity for the view object.
\param dIntensity [in] A double value that represents the new intensity of the default light.
\returns A value of the type that contains the result of the operation.
\remarks
If the new default light intensity was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing View Lighting
*/
virtual OdTvResult setDefaultLightingIntensity(double dIntensity) = 0;
/** \details
Retrieves the current default light color of the view object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns A object that represents the current default light color.
\remarks
If the rc parameter is not null and the current default light color was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing View Lighting
*/
virtual OdTvColorDef defaultLightingColor(OdTvResult* rc = NULL) const = 0;
/** \details
Sets a new default light color for the view object.
\param color [in] A object that represents the new default light color.
\returns A value of the type that contains the result of the operation.
\remarks
If the new default light color was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing View Lighting
*/
virtual OdTvResult setDefaultLightingColor(const OdTvColorDef& color) = 0;
/** \details
Retrieves the current value of the save flag. The save flag determines whether the view content should be saved in a file (if true) or not (if false).
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns true if the view should be saved in a file; otherwise returns false.
\remarks
If the rc parameter is not null and the current value of the save flag was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
*/
virtual bool getNeedSaveInFile(OdTvResult* rc = NULL) const = 0;
/** \details
Sets the view to be active or inactive.
\param bIsActive [in] A new value of the active flag for the view. If the flag is equal to true, the view becomes active; otherwise the view becomes inactive.
\returns A value of the type that contains the result of activating (or deactivating) the view.
\remarks
If the view was successfully activated or deactivated, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing View Lighting
*/
virtual OdTvResult setActive(bool bIsActive) = 0;
/** \details
Retrieves the current value of the active flag for the view. If the view is active, the flag is equal to true; otherwise the flag is equal to false.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns true if the view is active; otherwise returns false.
\remarks
If the rc parameter is not null and the current value of the active flag was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing View Lighting
*/
virtual bool getActive(OdTvResult* rc = NULL) const = 0;
/** \details
Sets a new color and width of the border for the view object.
\param color [in] A new border color value.
\param width [in] A new border width in pixels.
\returns A value of the type that contains the result of the operation.
\remarks
If the new border color and width were successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing View Borders
*/
virtual OdTvResult setBorderProperties(ODCOLORREF color, OdUInt32 width) = 0;
/** \details
Retrieves the current border color and width for the view object.
\param color [out] A placeholder for the border color value.
\param width [out] A placeholder for the border width in pixels.
\returns A value of the type that contains the result of the operation.
\remarks
If the current border color and width were successfully returned to a calling subroutine, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing View Borders
*/
virtual OdTvResult getBorderProperties(ODCOLORREF& color, OdUInt32& width) const = 0;
/** \details
Sets a new value of the border visibility flag. The border visibility flag determines whether the border of the view is visible (if true) or invisible (if false).
\param bVisible [in] A new border visibility flag value.
\returns A value of the type that contains the result of the operation.
\remarks
If the new value of the border visibility flag was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing View Borders
*/
virtual OdTvResult setBorderVisibility(bool bVisible) = 0;
/** \details
Retrieves the current value of the border visibility flag value for the view object. The border visibility flag determines whether the border of the view is visible (if true) or invisible (if false).
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns true if the border is visible for the view; otherwise returns false.
\remarks
If the rc parameter is not null and the current value of the border visibility flag was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing View Borders
*/
virtual bool getBorderVisibility(OdTvResult *rc = NULL) const = 0;
/** \details
Defines a polygonal clip region for the view object.
\param numContours [in] A quantity of polygonal contours.
\param numVertices [in] An array of vertex quantities for each polygonal contour.
\param vertices [in] Array of the device coordinates (in pixels) of the vertices that define polygonal contours.
\returns A value of the type that contains the result of the operation.
\remarks
If the clip region was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Camera Parameters
*/
virtual OdTvResult setClipRegion(OdUInt32 numContours, OdUInt32 const* numVertices, OdTvPoint2d const* vertices) = 0;
/** \details
Defines a polygonal clip region for the view object.
\param numContours [in] A quantity of polygonal contours.
\param numVertices [in] An array of vertex quantities for each polygonal contour.
\param vertices [in] Array of the world coordinates of the vertices that define polygonal contours.
\returns Returns a value of type that contains the result of the operation.
\remarks
The incoming WCS(ECS) contour's coordinates are automatically multiplied by 'worldToDevice' matrix during each update.
If the clip region was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Camera Parameters
*/
virtual OdTvResult setClipRegion( OdUInt32 numContours, OdUInt32 const* numVertices, OdTvPoint const* vertices ) = 0;
/** \details
Retrieves the current polygonal clip region for the view.
\param counts [out] A placeholder for the array of the vertex quantities for each polygonal contour.
\param vertices [out] A placeholder for the array of device coordinates (in pixels) of the vertices, which define polygonal contours.
\returns A value of the type that contains the result of the operation.
\remarks
If the clip region was successfully returned to a calling subroutine, the method returns the tvOk value; otherwise it returns an appropriate error code.
If view has clip region in world coordinate system this method returns empty arrays and tvWarning as return code.
\sa
Managing Camera Parameters
*/
virtual OdTvResult getClipRegion(OdUInt32Array& counts, OdTvPoint2dArray& vertices) const = 0;
/** \details
Retrieves the current polygonal clip region for the view.
\param counts [out] A placeholder for the array of the vertex quantities for each polygonal contour.
\param vertices [out] A placeholder for the array of world coordinates of the vertices, which define polygonal contours.
\returns Returns a value of type that contains the result of the operation.
\remarks
If the clip region was successfully returned to a calling subroutine, the method returns the tvOk value; otherwise it returns an appropriate error code.
If view has clip region in device coordinate system (pixels) this method returns empty arrays and tvWarning as return code.
\sa
Managing Camera Parameters
*/
virtual OdTvResult getClipRegion( OdUInt32Array& counts, OdTvPointArray& vertices ) const = 0;
/** \details
Checks whether view has polygonal clip region in world coordinates.
\param pResult [out] A pointer to a value of type that contains the result of the operation.
\returns Returns true if and only if view has polygonal clip region in world coordinates; otherwise returns false.
*/
virtual bool hasWCSClipRegion( OdTvResult* pResult = NULL ) const = 0;
/** \details
Removes the current polygonal clip region from the view.
\returns A value of the type that contains the result of the operation.
\remarks
If current clip region was successfully removed, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Camera Parameters
*/
virtual OdTvResult removeClipRegion() = 0;
/** \details
Inherites clip region from specified view.
\param viewId [in] Clip region owner.
\returns A value of the type that contains the result of the operation.
*/
virtual OdTvResult inheritClipRegionFrom( OdTvGsViewId viewId ) = 0;
/** \details
Retrives clip region owner.
\param pResult [out] A pointer to a value of type that contains the result of the operation.
\returns Clip region owner if it specified; otherwise returns empty view id.
*/
virtual OdTvGsViewId clipRegionOwner( OdTvResult * pResult = NULL ) const = 0;
/** \details
Retrives clip region inheritantes.
\param pResult [out] A pointer to a value of type that contains the result of the operation.
\returns A pointer to the vector of clip region heirs.
*/
virtual const OdVector< OdTvGsViewId >* clipRegionInheritantes( OdTvResult* pResult = NULL ) const = 0;
/** \details
Sets a new name for the view.
\param sName [in] A view name represented with a string value up to 255 characters long.
\returns A value of the type that contains the result of the operation.
\remarks
The name is an arbitrary non-empty string that can contain letters, digits, blank spaces,
underscores, and some special characters, but cannot contain inadmissible letters
("<", ">", "\", "/", ":", ";", "?", ",", "*", "|", "=", "'", quotation marks and some special characters created with Unicode fonts).
If the new name was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Setting and Getting View Names
*/
virtual OdTvResult setName(const OdString& sName) = 0;
/** \details
Retrieves the current name of the view.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The current name of the view object.
\remarks
If the rc parameter is not null and the view name was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Setting and Getting View Names
*/
virtual OdString getName(OdTvResult* rc = NULL) const = 0;
/** \details
Adds a sibling view (parameters of the view are copied to the added sibling view).
\param id [in] An identifier of a sibling view object.
\returns A value of the type that contains the result of the operation.
\remarks
If the new sibling view was successfully added, the method returns the tvOk value; otherwise it returns an appropriate error code.
*/
virtual OdTvResult addSibling(const OdTvGsViewId& id) = 0;
/** \details
Removes view from the sibling list
\param id [in] An identifier of a sibling view object.
\returns A value of the type that contains the result of the operation.
\remarks
If the view was successfully removed from te sibling list, the method returns the tvOk value; otherwise it returns an appropriate error code.
*/
virtual OdTvResult removeSibling(const OdTvGsViewId& id) = 0;
/** \details
Retrieves the owner view object that controls the parameters of the view object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The identifier of the owner view. If the view does not have an owner view, the isNull() method of the returned identifier returns true.
\remarks
If the rc parameter is not null and the owner view identifier was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
*/
virtual OdTvGsViewId getSiblingOwner(OdTvResult *rc = NULL) const = 0;
/** /details
Adds a new viewport object to the view object (the view controls the screen rectangle of the added viewport).
\param id [in] An identifier of the added viewport.
\param viewportInfo [in] Viewport information.
\returns A value of the type that contains the result of the viewport operation.
\remarks
If the new viewport was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Viewports
*/
virtual OdTvResult addViewportObject(const OdTvGsViewId &id, const ViewportObjectInfo& viewportInfo) = 0;
/** \details
Inserts a specified viewport object to a specified position in the viewport objects collection.
\param viewportIndex [in] An index of the viewport objects collection that specifies the position for the newly inserted view.
\param viewportId [in] An identifier of a viewport object represented with an object.
\returns A value of the type that contains the result of adding a viewport to the view.
\remarks
If the new viewport object was successfully added to the view, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Views
*/
virtual OdTvResult insertViewportObject(int viewportIndex, const OdTvGsViewId& viewportId) = 0;
/** \details
Removes a specified viewport object from the view's viewport object collection.
\param viewportId [in] An identifier of a viewport object represented with an object.
\param rc [out] A pointer to a value of the type that contains the result of the operation.
\returns true if the view object is successfully removed from the view, otherwise returns false.
\remarks
If the rc parameter is not null and the view is successfully removed from the view, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Views
*/
virtual bool removeViewportObject(const OdTvGsViewId& viewportId, OdTvResult* rc = NULL) = 0;
/** \details
Retrieves the quantity of viewport objects associated with the view.
\param rc [out] A pointer to a value of the type that contains the result of the operation.
\returns The number of views associated with the view object.
\remarks
If the rc parameter is not null and the viewports quantity was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Views
*/
virtual int numViewportObjects(OdTvResult* rc = NULL) const = 0;
/** \details
Retrieves the viewport object located at a specified position in the list of views associated with the view.
\param viewportIndex [in] A position in the list of views associated with the view.
\param rc [out] A pointer to a value of the type that contains the result of the operation.
\returns The identifier of the viewport object.
\remarks
If the view object was found and its identifier was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Views
*/
virtual OdTvGsViewId viewportObjectAt(int viewportIndex, OdTvResult* rc = NULL) = 0;
/** \details
Retrieves the viewport object located at a specified screen position.
\param screenPoint [in] A screen position represented with a two-dimensional point in the view coordinate space.
\param rc [out] A pointer to a value of the type that contains the result of the operation.
\returns The identifier of the viewport object.
\remarks
If the viewport object was found and its identifier was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Views
*/
virtual OdTvGsViewId viewportObjectAt(const OdTvPoint2d& screenPoint, OdTvResult* rc = NULL) = 0;
/** \details
Retrieves the view object that controls the current viewport.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\remarks
If the rc parameter is not null and the identifier of the viewport owner object was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\returns An identifier of the owner view object.
\sa
Managing Viewports
*/
virtual OdTvGsViewId getViewportObjectOwner(OdTvResult *rc = NULL) const = 0;
/** \details
Retrieves the view object that controls the current viewport and the viewport info.
\param viewportInfo [out] A reference value for the viewport object info, if there is owner viewport, structure will be filled.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\remarks
If the rc parameter is not null and the identifier of the viewport owner object was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\returns An identifier of the owner view object.
\sa
Managing Viewports
*/
virtual OdTvGsViewId getViewportObjectOwner(ViewportObjectInfo& viewportInfo, OdTvResult *rc = NULL) const = 0;
/** \details
Sets a new value for the two-dimensional mode flag. If this flag is equal to true, the rotation, pan and orbit operations for the view are denied. If the flag value is equal to false, the view works in three-dimensional mode.
\param b2dEnable [in] A new two-dimensional mode flag value.
\returns A value of the type that contains the result of the operation.
\remarks
If the new flag value was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
*/
virtual OdTvResult set2dMode(bool b2dEnable) = 0;
/** \details
Retrieves the current value of the two-dimensional flag.
If this flag is equal to true, the rotation, pan and orbit operations for the view are denied. If the flag value is equal to false, the view works in three-dimensional mode.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns true if the view is in two-dimensional mode; otherwise returns false.
\remarks
If the rc parameter is not null and the value of the two-dimensional flag was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
*/
virtual bool get2dMode(OdTvResult *rc = NULL) const = 0;
/** \details
Sets a new visual style to the view.
\param id [in] An identifier of the visual style object.
\returns A value of the type that contains the result of setting the visual style.
\remarks
If the new visual style was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
*/
virtual OdTvResult setVisualStyle(const OdTvVisualStyleId& id) = 0;
/** \details
Retrieves the current visual style for the view.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns An identifier of the current visual style.
\remarks
If the current visual style object was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
*/
virtual OdTvVisualStyleId getVisualStyle(OdTvResult *rc = NULL) const = 0;
/** \details
Hides a specified layer in the view.
\param id [in] An identifier of the layer that should be hidden.
\returns A value of the type that contains the result of hiding a layer.
\remarks
If the specified layer was successfully hidden, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
*/
virtual OdTvResult hideLayer(const OdTvLayerId& id) = 0;
/** \details
Shows (unhides) a specified layer in the view.
\param id [in] An identifier of the layer that should be shown.
\returns A value of the type that contains the result of unhiding a layer.
\remarks
If the specified layer was successfully shown, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
*/
virtual OdTvResult unhideLayer(const OdTvLayerId& id) = 0;
/** \details
Shows (unhides) all layers in the view.
\returns A value of the type that contains the result of showing all layers.
\remarks
If all layers were successfully shown, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
*/
virtual OdTvResult unhideAllLayers() = 0;
/** \details
Retrieves the current value of the hidden flag for a specified layer in the view. The hidden flag is equal to true if a specified layer is hidden; otherwise it is equal to false.
\param id [in] An identifier of a layer object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns true if the layer is hidden; otherwise the method returns false.
\remarks
If the rc parameter is not null and the hidden flag value was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
*/
virtual bool isLayerHidden(const OdTvLayerId& id, OdTvResult *rc = NULL) = 0;
/** \details
Retrieves all hidden layers from the view.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns An array of identifiers of hidden layers.
\remarks
If the rc parameter is not null and the array of identifiers of hidden layers was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
*/
virtual OdTvLayerIdsArray getHiddenLayers(OdTvResult *rc = NULL) = 0;
/** \details
Sets front clipping for the view and the front clipping distance from the camera target of the view.
\param bEnable [in] A front clipping enable flag. If the flag is equal to true, front clipping is enabled; otherwise front clipping is disabled.
\param frontClip [in] A front clipping distance.
\returns A value of the type that contains the result of enabling or disabling front clipping.
\remarks
If front clipping was successfully enabled or disabled, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Camera Parameters
*/
virtual OdTvResult setFrontClip(bool bEnable, double frontClip = 1.0) = 0;
/** \details
Retrieves the current front clipping flag value and the front clipping distance from the camera target.
If front clipping is enabled, the flag value is equal to true; otherwise the flag value is equal to false.
\param frontClip [out] A placeholder for the front clipping distance value.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns true if front clipping is enabled for the view; otherwise returns false.
\remarks
If the rc parameter is not null and the information about front clipping for the view was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Camera Parameters
*/
virtual bool getFrontClip(double& frontClip, OdTvResult *rc = NULL) const = 0;
/** \details
Sets back clipping for the view and the back clipping distance from the camera target of the view.
\param bEnable [in] A back clipping enable flag. If the flag is equal to true, back clipping is enabled; otherwise back clipping is disabled.
\param backClip [in] A back clipping distance.
\returns A value of the type that contains the result of enabling or disabling back clipping.
\remarks
If back clipping was successfully enabled (or disabled), the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
Managing Camera Parameters
*/
virtual OdTvResult setBackClip(bool bEnable, double backClip = 0.0) = 0;
/** \details
Retrieves the current back clipping flag value and the back clipping distance from the camera target.
If back clipping is enabled, the flag value is equal to true; otherwise the flag value is equal to false.
\param backClip [out] A placeholder for the back clipping distance value.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns true if back clipping is enabled for the view; otherwise returns false.
\remarks
If the rc parameter is not null and the information about back clipping for the view was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Camera Parameters
*/
virtual bool getBackClip(double& backClip, OdTvResult *rc = NULL) const = 0;
/** \details
Sets a new background object for the view.
\param backgroundId [in] An identifier of the background object.
\returns A value of the type that contains the result of setting a background object.
\remarks
If the new background object was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
\sa
*/
virtual OdTvResult setBackground(const OdTvGsViewBackgroundId& backgroundId) = 0;
/** \details
Retrieves the current background object for the view.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns An identifier of the background object.
\remarks
If the rc parameter is not null and the background object identifier was successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
*/
virtual OdTvGsViewBackgroundId getBackground(OdTvResult *rc = NULL) = 0;
/** \details
Starts the view interactivity mode.
\param frameRateInHz [in] A frame rate value (FPS).
\returns A value of the type that contains the result of the operation.
\remarks
The frame rate value defines the desired minimum number of frames shown per one second.
In other words, if you want to limit the time that each redraw operation takes (e.g., not more than X seconds),
the frameRateInHz parameter value should be the inverse ratio of this time limit (1 / X).
If the view interactivity mode is successfully started, the method returns tvOk value; otherwise it returns an appropriate error code.
\sa
Using Interactivity Mode
*/
virtual OdTvResult beginInteractivity(double frameRateInHz) = 0;
/** \details
Starts the view interactivity mode.
\returns A value of the type that contains the result of the operation.
\remarks
The frame rate value will be get from device interactivity options, this value defines the desired minimum number of frames shown per one second.
If the view interactivity mode is successfully started, the method returns tvOk value; otherwise it returns an appropriate error code.
\sa
Using Interactivity Mode
*/
virtual OdTvResult beginInteractivity() = 0;
/** \details
Retrieves whether the view is currently in interactive mode.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns true if the view is in interactive mode; otherwise the method returns false.
\remarks
If the rc parameter is not null and the interactivity mode flag value is successfully returned,
the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Using Interactivity Mode
*/
virtual bool isInInteractivity(OdTvResult *rc = NULL) const = 0;
/** \details
Retrieves the current frame rate value (FPS) for the view interactivity mode.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The current frame rate value.
\remarks
The frame rate value can be specified through calling the
method.
If the rc parameter is not null and the frame rate value for the interactivity mode is successfully returned,
the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Using Interactivity Mode
*/
virtual double getInteractivityFrameRate(OdTvResult *rc = NULL) const = 0;
/** \details
Stops the view interactivity mode.
\returns A value of the type that contains the result of the operation.
\remarks
If the view interactivity mode is successfully stopped, the method returns tvOk value;
otherwise it returns an appropriate error code.
\sa
Using Interactivity Mode
*/
virtual OdTvResult endInteractivity() = 0;
/** \details
Retrieves the extents, which were returned by the last call of the
method.
\param extents [out] A placeholder for the extents object.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns true if the last extents object is successfully returned;
otherwise the method returns false.
\remarks
If the rc parameter is not null and the method call is successful, the rc parameter accepts the tvOk value;
otherwise it contains an appropriate error code.
If the method was not called,
the method returns false.
*/
virtual bool getLastViewExtents(OdGeBoundBlock3d& extents, OdTvResult *rc = NULL) const = 0;
/** \details
Add cutting plane to the view.
\param plane [in] Plane object.
\returns A value of the type that contains the result of the operation.
\sa
Managing Cutting Planes
*/
virtual OdTvResult addCuttingPlane(const OdTvPlane& plane) = 0;
/** \details
Retrieves the plane object associated with the given cutting plane.
\param idPlane [in] Index of the plane.
\param plane [out] Plane object.
\returns A value of the type that contains the result of the operation.
\sa
Managing Cutting Planes
*/
virtual OdTvResult getCuttingPlane(OdUInt32 idPlane, OdTvPlane& plane) const = 0;
/** \details
Updates the plane object associated with the given cutting plane.
\param idPlane [in] Index of the plane.
\param plane [in] Plane object.
\param bCallDeviceInvalidate [in] Indicates that it is need to call 'invalidate' method of the device.
\returns A value of the type that contains the result of the operation.
\sa
Managing Cutting Planes
*/
virtual OdTvResult updateCuttingPlane(OdUInt32 idPlane, const OdTvPlane& plane, bool bCallDeviceInvalidate = false) = 0;
/** \details
Returns the number of cutting planes.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The number of cutting planes.
\remarks
If the rc parameter is not null and the number of cutting planes is successfully returned,
the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Cutting Planes
*/
virtual OdUInt32 numCuttingPlanes(OdTvResult *rc = NULL) const = 0;
/** \details
Removes the cutting plane with the given plane index.
\param idPlane [in] Index of the plane.
\returns A value of the type that contains the result of the operation.
\sa
Managing Cutting Planes
*/
virtual OdTvResult removeCuttingPlane(OdUInt32 idPlane) = 0;
/** \details
Removes all cutting planes.
\returns A value of the type that contains the result of the operation.
\sa
Managing Cutting Planes
*/
virtual OdTvResult removeCuttingPlanes() = 0;
/** \details
Sets the fill parameters of cutting planes.
\param bEnable [in] A fill enable flag. If the flag is equal to true, filling is enabled; otherwise filling is disabled.
\param color [in] A fill color.
\returns A value of the type that contains the result of the operation.
\remarks
When filling multiple cutting planes instead of only one, artifacts are possible.
\sa
Managing Cutting Planes
*/
virtual OdTvResult setEnableCuttingPlaneFill(bool bEnable, ODCOLORREF color = ODRGBA(255, 0, 0, 255)) = 0;
/** \details
Returns the fill parameters of the cutting planes.
\param color [out] A fill color.
\param rc [out] A pointer to a value of the type that contains the result of the operation.
\returns true if filling is enabled or false otherwise.
\remarks
If the rc parameter is not null and the parameters of the cutting plane filling is successfully returned,
the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Cutting Planes
*/
virtual bool getCuttingPlaneFillEnabled(ODCOLORREF& color, OdTvResult *rc = NULL) const = 0;
/** \details
Sets the fill pattern parameters of cutting planes.
\param bEnable [in] A fill pattern enable flag. If the flag is equal to true, the fill pattern is enabled; otherwise the fill pattern is disabled.
\param fillStyle [in] A fill pattern style.
\param color [in] A fill pattern color.
\returns A value of the type that contains the result of the operation.
\sa
Managing Cutting Planes
*/
virtual OdTvResult setCuttingPlaneFillPatternEnabled(bool bEnable, OdTvGsView::CuttingPlaneFillStyle fillStyle, ODCOLORREF color = ODRGB(255, 0, 0)) = 0;
/** \details
Returns the fill pattern parameters of cutting planes.
\param fillStyle [out] A fill pattern color.
\param color [out] A fill pattern style.
\param rc [out] A pointer to a value of the type that contains the result of the operation.
\returns true if the fill pattern is enabled or false otherwise.
\remarks
If the rc parameter is not null and the parameters of the cutting plane filling pattern is successfully returned,
the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
\sa
Managing Cutting Planes
*/
virtual bool getCuttingPlaneFillPatternEnabled(OdTvGsView::CuttingPlaneFillStyle& fillStyle, ODCOLORREF& color, OdTvResult *rc = NULL) const = 0;
/** \details
Saves an image of the current view to a file at the specified path.
\param imagePath [in] Path to the file for saving.
\param region [in] Rectangle specifies the view's region to return.
\returns A value of the type that contains the result of the operation.
*/
virtual OdTvResult getSnapShot(const OdString& imagePath, const OdTvDCRect& region) = 0;
/** \details
Returns the raster image object of the current view.
\param region [in] Rectangle specifies the view's region to return.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns A smart pointer to an object that represents the image of the current view.
*/
virtual OdGiRasterImagePtr getSnapShot(const OdTvDCRect& region, OdTvResult* rc = NULL) = 0;
/** \details
Allows overruling of the anti-aliasing behavior in the current view.
\param overrule [in] Value in the range [0; 3]. 0 means nothing to overrule; 1 means disable interprocess AA (LineSmoothing);
2 means disable postprocess AA (FXAA); 3 means disable both AA.
\returns A value of the type that contains the result of the operation.
*/
virtual OdTvResult setAntiAliasingOverrule(OdUInt32 overrule) = 0;
/** \details
Returns the overrule value for the anti-aliasing behavior in the current view.
\param rc [out] A pointer to a value of the type that contains the result of the operation.
\returns The value in the range [0; 3]. 0 means nothing to overrule; 1 means disable interprocess AA (LineSmoothing);
2 means disable postprocess AA (FXAA); 3 means disable both AA.
*/
virtual OdUInt32 getAntiAliasingOverrule(OdTvResult* rc = NULL) const = 0;
/** \details
Allows overruling of a screen-space ambient occlusion (SSAO) in the current view.
\param bEnable [in] The flag that indicates whether ambient occlusion should be enabled in the current view.
\returns A value of the type that contains the result of the operation.
\remarks
This overrule has an effect only if the SSAO is switched on in the parent's OdTvGsDevice.
*/
virtual OdTvResult setSSAOEnabled(bool bEnable) = 0;
/** \details
Returns the overrule flag for a screen-space ambient occlusion in the current view.
\param rc [out] The flag that indicates whether ambient occlusion is enabled in the current view.
\returns true if the SSAO is enabled, or false otherwise.
*/
virtual bool getSSAOEnabled(OdTvResult* rc = NULL) const = 0;
/** \details
Returns the camera object that is assigned to this view.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns The ID of the assigned camera object or an empty ID if no camera is assigned.
\remarks
A view can be assigned with only one camera at a time. Call TvCamera::unassignView before assigning another camera.
*/
virtual OdTvEntityId assignedCamera( OdTvResult* rc = NULL ) const = 0;
/** \details
Checks whether the lens length of a view should be adjusted to match all parameters of the setView() method.
\param rc [out] A pointer to a value of the type that contains the result of the operation.
\returns true if the lens length of the view should be adjusted, otherwise returns false.
*/
virtual bool getAdjustLensLength( OdTvResult* rc = NULL ) const = 0;
/** \details
Specifies whether the lens length of a view should be adjusted to match all parameters of the setView() method.
\param bAdjust [in] The flag that indicates whether a view should adjust the lens length.
\returns A value of the type that contains the result of the operation.
*/
virtual OdTvResult setAdjustLensLength( bool bAdjust ) = 0;
/** \details
Checks whether a view intersects with the specified extents.
\param extents [in] Extents to be checked.
\param rc [out] A pointer to a value of the type that contains the result of the operation.
\returns true if the view intersects with the specified extents; otherwise returns false.
\remarks
This method works only after the first update; otherwise rc is tvNullObjectPtr.
*/
virtual bool isExtentsInView( const OdTvExtents3d& extents, OdTvResult* rc = NULL ) const = 0;
/** \details
Sets the flag that determines whether the data on hidden layers in this view object
are taken into account during extents calculations.
\param bTakeIntoAccount [in] Allows data on hidden layers in this view object to be taken into account during extents calculations.
\returns A value of the type that contains the result of the operation.
\remarks
Default value is false.
*/
virtual OdTvResult setTakeIntoAccountDataAtHidenLayersInExtents(bool bTakeIntoAccount) = 0;
/** \details
Retrieves the current value of the flag that determines whether the data on hidden layers in this view object
are taken into account during extents calculations.
\param rc [out] A pointer to a value of the type that contains the result of the operation.
\returns true if the data on hidden layers in this view object should be taken into account during extents calculations; otherwise returns false.
\remarks
If the rc parameter is not null and the current value of the save flag is successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
*/
virtual bool getTakeIntoAccountDataAtHidenLayersInExtents(OdTvResult* rc = NULL) const = 0;
/** \details
Sets the 3D clipping for this view object.
\param pBoundary [in] 3D clipping boundary.
\returns A value of the type that contains the result of the operation.
*/
virtual OdTvResult set3DClipping(const OdTvClipBoundary* pBoundary = NULL) = 0;
/** \details
Returns the current 3D clipping boundary for this view object.
\param rc [out] Optional. A pointer to a value of the type that contains the result of the operation.
\returns A pointer to the 3D clipping data. Returns null if a 3D clipping boundary is not set.
*/
virtual const OdTvClipBoundary* get3DClipping(OdTvResult* rc = NULL) const = 0;
/** \details
Removes 3D clipping from this view object.
\returns A value of the type that contains the result of the operation.
*/
virtual OdTvResult remove3DClipping() = 0;
/** \details
Sets the hatch scale for a section of the 3D clipping.
\param dScale [in] New scale value.
\returns A value of the type that contains the result of this operation.
\remarks
If the hatch scale is successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code. Default value is 1.
*/
virtual OdTvResult setHatchScaleFor3DClippingSection(double dScale) = 0;
/** \details
Returns the hatch scale for a section of the 3D clipping.
\param rc [out] A pointer to a value of the type that contains the result of the operation.
\returns The hatch scale for the section of the 3D clipping.
*/
virtual double getHatchScaleFor3DClippingSection(OdTvResult* rc = NULL) const = 0;
/** \details
Sets the visibility for view object.
\param bVisible [in] New visibility value.
\param cameraId [in] Id of camera object, from which parameters will be applied to view. Works in case if bVisible is true.
\returns A value of the type that contains the result of this operation.
\remarks
If the visibility is successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
*/
virtual OdTvResult setVisible(bool bVisible, const OdTvEntityId& cameraId = OdTvEntityId()) = 0;
/** \details
Checks whether the view object is visible.
\param rc [out] A pointer to a value of the type that contains the result of the operation.
\returns true if the wrapped viewport object is visible, false otherwise.
\remarks
If the rc parameter is not null and the current value of the save flag is successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
*/
virtual bool isVisible(OdTvResult* rc = nullptr) const = 0;
/** \details
Enables ray trace in the current view object.
\param bEnable [in] The flag that indicates whether ray trace should be enabled in the current view.
\returns A value of the type that contains the result of the operation.
\remarks
If the ray trace is successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
*/
virtual OdTvResult setRayTraceEnabled(bool bEnable) = 0;
/** \details
Checks whether the ray trace enabled in the current view object.
\param rc [out] A pointer to a value of the type that contains the result of the operation.
\returns true if the ray trace enabled in the current view object, false otherwise.
\remarks
If the rc parameter is not null and the current value of the save flag is successfully returned, the rc parameter accepts the tvOk value; otherwise it contains an appropriate error code.
*/
virtual bool isRayTraceEnabled(OdTvResult* rc = nullptr) const = 0;
/** \details
Sets a new ray trace render settings to the view.
\param id [in] An identifier of the render settings object.
\returns A value of the type that contains the result of setting the render settings.
\remarks
If the new render settings was successfully set, the method returns the tvOk value; otherwise it returns an appropriate error code.
*/
virtual OdTvResult setRayTraceRenderSettings(const OdTvRtRenderSettingsId& id) = 0;
/** \details
Retrieves the current ray trace render settings for the view.
\param rc [out] A pointer to a value of type that contains the result of the operation.
\returns An identifier of the current render settings.
\remarks
If the current render settings object was successfully returned, the method returns the tvOk value; otherwise it returns an appropriate error code.
*/
virtual OdTvRtRenderSettingsId getRayTraceRenderSettings(OdTvResult* rc = NULL) const = 0;
};
/** \details
A data type that represents a smart pointer to an object.
*/
typedef OdTvSmartPtr OdTvGsViewPtr;
/** \details
The interface class for a view object identifier that allows access to the object.
*/
class ODTV_EXPORT OdTvGsViewId : public OdTvId
{
public:
/** \details
Opens the view determined by its identifier for a read or write operation.
\param mode [in] An open mode value.
\param rc [out] A pointer to a value of type that contains the result of the open operation.
\returns A smart pointer to the view object.
\remarks
If the rc parameter is not null and the view object was successfully opened, the rc parameter accepts the tvOk value;
otherwise it contains an appropriate error code.
*/
OdTvGsViewPtr openObject(OdTv::OpenMode mode = OdTv::kForRead, OdTvResult* rc = NULL) const;
};
#endif //_ODTV_GSVIEW_H_INCLUDED_