Defines a viewport without any visible window (frame). More...
Public Types | |
typedef cadex::internal::ModelPrs_OffscreenViewPortImpl | ImplType |
Public Member Functions | |
ModelPrs_OffscreenViewPort () | |
Constructor. | |
bool | AttachToScene (const ModelPrs_Scene &theScene) |
Attaches to ModelPrs_Scene. | |
void | Resize (unsigned int theWidth, unsigned int theHeight) |
Resizes ViewPort. | |
bool | GrabToImage (const Base_UTF16String &thePath) const |
Grab to image in specified thePath. | |
ModelData_PixMap | GrabToPixMap () const |
Grab to pixmap. | |
void | FitAll () |
Fit content to ViewPort size. | |
void | FitBox (const ModelData_Box &theBox) |
Fit content to box. | |
void | RotateToAngle (ModelPrs_AxisType theType, double theAngle) |
Rotate to angle around specified Axis. | |
const ModelPrs_BackgroundStyle & | BackgroundStyle () const |
Returns a background style. | |
void | SetBackgroundStyle (const ModelPrs_BackgroundStyle &theStyle) |
Sets a background style. | |
const ModelPrs_ViewCubeStyle & | ViewCubeStyle () const |
Sets a view cube style. | |
void | SetViewCubeStyle (const ModelPrs_ViewCubeStyle &theStyle) |
Returns a view cube style. | |
const ModelData_Box2d & | ViewCubeGeometry () const |
Returns a view cube geometry. | |
void | SetViewCubeGeometry (const ModelData_Box2d &theBox) |
Sets a view cube geometry. | |
bool | ViewCubeEnabled () const |
Return a view cube enabled state. | |
void | SetViewCubeEnabled (bool theEnabled) |
Sets a visibility of view cube. | |
ModelPrs_CameraProjectionType | CameraProjectionType () const |
Returns a camera projection type. | |
void | SetCameraProjectionType (ModelPrs_CameraProjectionType theType) |
Sets a camera projection type. | |
void | SetCameraPositionType (ModelPrs_CameraPositionType theOrientation) |
Sets a camera position type. | |
void | SetCameraView (const ModelData_Point &thePosition, const ModelData_Point &theTarget, const ModelData_Direction &theUp) |
Sets a custom camera position. | |
ModelPrs_Exploder | Exploder () |
Returns object to manage model explosion. | |
![]() | |
void | Nullify () |
Resets reference to implementation object. | |
bool | IsNull () const |
Returns true if the object is nullified. | |
operator bool () const | |
Casts the object to the bool type. | |
internal::Base_HandledObject * | Impl () const |
Return a handle to backend (reserved for internal use). | |
Additional Inherited Members | |
![]() | |
Base_PublicObject (const internal::Base_HandledObject *theObject) | |
Constructor (reserved for internal use). | |
template<typename T > | |
T * | GetOrCreateImpl () |
Reserved for internal use. | |
Defines a viewport without any visible window (frame).
The off-screen component encapsulates an unvisible viewport which is used to display objects in 3D space.
The following code snippet demonstrates how to use this for image generations:
An off-screen viewport contains a shared pointer to its internal implementation, so simple copying an object will just copy a shared pointer. Therefore any modification of the copied object will propagate to original object.
bool cadex::ModelPrs_OffscreenViewPort::AttachToScene | ( | const ModelPrs_Scene & | theScene | ) |
Attaches to ModelPrs_Scene.
Scene will notifies attached ViewPort about changes and it will do redraw.
const ModelPrs_BackgroundStyle & cadex::ModelPrs_OffscreenViewPort::BackgroundStyle | ( | ) | const |
Returns a background style.
ModelPrs_CameraProjectionType cadex::ModelPrs_OffscreenViewPort::CameraProjectionType | ( | ) | const |
Returns a camera projection type.
bool cadex::ModelPrs_OffscreenViewPort::GrabToImage | ( | const Base_UTF16String & | thePath | ) | const |
Grab to image in specified thePath.
Requires to provide a full path to output file including extension:
The file name extension must be one of .png, .jpg, .bmp, .gif. The image size will equal to ViewPort size. This image size manages by Resize():
ModelData_PixMap cadex::ModelPrs_OffscreenViewPort::GrabToPixMap | ( | ) | const |
void cadex::ModelPrs_OffscreenViewPort::Resize | ( | unsigned int | theWidth, |
unsigned int | theHeight | ||
) |
Resizes ViewPort.
Both values must be more then zero.
void cadex::ModelPrs_OffscreenViewPort::SetBackgroundStyle | ( | const ModelPrs_BackgroundStyle & | theStyle | ) |
Sets a background style.
void cadex::ModelPrs_OffscreenViewPort::SetCameraProjectionType | ( | ModelPrs_CameraProjectionType | theType | ) |
Sets a camera projection type.
void cadex::ModelPrs_OffscreenViewPort::SetViewCubeStyle | ( | const ModelPrs_ViewCubeStyle & | theStyle | ) |
Returns a view cube style.
const ModelPrs_ViewCubeStyle & cadex::ModelPrs_OffscreenViewPort::ViewCubeStyle | ( | ) | const |
Sets a view cube style.