Hide menu

Defines a QQuickItem which can be used in QtQuick/QML based applications. More...

Inherits QQuickFramebufferObject.

Classes

class  Renderer
 Defines a renderer object which will be created by ModelPrsQtQuick_ViewPort. More...
 

Public Types

enum  MouseMode { Normal, FitArea }
 
enum  CameraProjectionType { Isometric, Perspective }
 
typedef cadex::internal::ModelPrsQtQuick_ViewPortImpl ImplType
 

Signals

void mouseModeChanged ()
 
void cameraProjectionTypeChanged ()
 
void highlightEnabledChanged ()
 
void selectionEnabledChanged ()
 
void trihedronEnabledChanged ()
 
void gridPlaneEnabledChanged ()
 
void backgroundStyleChanged ()
 
void viewCubeStyleChanged ()
 
void viewCubeEnabledChanged ()
 
void viewCubeGeometryChanged ()
 

Public Member Functions

 ModelPrsQtQuick_ViewPort (QQuickItem *theParent=nullptr)
 Constructor.
 
bool AttachToScene (const ModelPrs_Scene &theScene)
 Attaches to ModelPrs_Scene. More...
 
Q_INVOKABLE void fitAll ()
 Fits content to ViewPort size. More...
 
Q_INVOKABLE void animatedFitAll ()
 Fits content to ViewPort size with animation. More...
 
void fitBox (const ModelData_Box &theBox)
 Fits content to box. More...
 
void animatedFitBox (const ModelData_Box &theBox)
 Fits content to box with animations. More...
 
CameraProjectionType cameraProjectionType () const
 
void setCameraProjectionType (CameraProjectionType theType)
 Sets camera projection type. More...
 
MouseMode mouseMode () const
 
void setMouseMode (MouseMode theMode)
 Sets mouse mode. More...
 
bool highlightEnabled () const
 
void setHighlightEnabled (bool theEnabled)
 Sets highlight enabled. More...
 
bool selectionEnabled () const
 
void setSelectionEnabled (bool theEnabled)
 Sets selection enabled. More...
 
bool viewCubeEnabled () const
 
void setViewCubeEnabled (bool theEnabled)
 Sets view cube enabled. More...
 
QRect viewCubeGeometry ()
 
void setViewCubeGeometry (const QRect &theRect)
 Sets view cube geometry. More...
 
bool trihedronEnabled () const
 
void setTrihedronEnabled (bool theEnabled)
 Sets global trihedron enabled. More...
 
bool gridPlaneEnabled () const
 
void setGridPlaneEnabled (bool theEnabled)
 Sets grid plane enabled. More...
 
const ModelPrs_BackgroundStyleBackgroundStyle () const
 Returns a background style.
 
void SetBackgroundStyle (const ModelPrs_BackgroundStyle &theStyle)
 Sets a background style.
 
const ModelPrs_ViewCubeStyleViewCubeStyle () const
 Returns a view cube style.
 
void SetViewCubeStyle (const ModelPrs_ViewCubeStyle &theStyle)
 Sets a view cube style.
 
ModelPrs_Manipulator Manipulator ()
 Returns manipulator object.
 
ModelPrs_Exploder Exploder ()
 Returns object to manage model explosion.
 
RenderercreateRenderer () const override
 Creates a renderer object.
 
QObject * backgroundStyle ()
 
void setBackgroundStyle (QObject *theStyle)
 
QObject * viewCubeStyle ()
 
void setViewCubeStyle (QObject *theStyle)
 
const std::shared_ptr< ImplType > & Impl () const
 Returns an implementation object (reserved for internal use).
 

Static Public Member Functions

static void RegisterQtTypes ()
 Registers QML types. More...
 

Protected Member Functions

void hoverEnterEvent (QHoverEvent *theEvent) override
 
void hoverMoveEvent (QHoverEvent *theEvent) override
 
void hoverLeaveEvent (QHoverEvent *theEvent) override
 
void mousePressEvent (QMouseEvent *theEvent) override
 
void mouseMoveEvent (QMouseEvent *theEvent) override
 
void mouseReleaseEvent (QMouseEvent *theEvent) override
 
void wheelEvent (QWheelEvent *theEvent) override
 
void touchEvent (QTouchEvent *theEvent) override
 

Protected Attributes

std::shared_ptr< ImplType > myImpl
 

Properties

MouseMode mouseMode
 
bool selectionEnabled
 
bool highlightEnabled
 
bool trihedronEnabled
 
bool gridPlaneEnabled
 
bool viewCubeEnabled
 
QRect viewCubeGeometry
 
QObject viewCubeStyle
 
QObject backgroundStyle
 
CameraProjectionType cameraProjectionType
 

Events

bool(QEvent *theEvent override )
 

Detailed Description

Defines a QQuickItem which can be used in QtQuick/QML based applications.

ModelPrsQtQuick_ViewPort encapsulates a viewport which is used to display objects in 3D space.

See also
Viewport, ModelPrs_OffscreenViewPort

The following code snippet demonstrates an usage:

id: viewPort
anchors.fill: parent
backgroundStyle: ModelPrsQtQuick_BackgroundStyle {
topColor: "#303030"
bottomColor: "#303030"
}
viewCubeStyle: ModelPrsQtQuick_ViewCubeStyle {
normalColor: "#6e6e6e"
hoveredColor: "#545454"
pressedColor: "#474747"
textColor: "#949494"
trihedronTextColor: "#949494"
}
}
See also
ModelPrsQtQuick_BackgroundStyle, ModelPrsQtQuick_ViewCubeStyle
Examples:
visualization/qtquick_qml/baseviewer/main.cxx.

Member Function Documentation

void cadex::ModelPrsQtQuick_ViewPort::animatedFitAll ( )

Fits content to ViewPort size with animation.

See also
fitAll()
void cadex::ModelPrsQtQuick_ViewPort::animatedFitBox ( const ModelData_Box theBox)

Fits content to box with animations.

See also
fitBox()
bool cadex::ModelPrsQtQuick_ViewPort::AttachToScene ( const ModelPrs_Scene theScene)

Attaches to ModelPrs_Scene.

Scene will notifies attached ViewPort about changes and it will do redraw.

void cadex::ModelPrsQtQuick_ViewPort::fitAll ( )

Fits content to ViewPort size.

See also
animatedFitAll()
void cadex::ModelPrsQtQuick_ViewPort::fitBox ( const ModelData_Box theBox)

Fits content to box.

See also
animatedFitBox()
void cadex::ModelPrsQtQuick_ViewPort::RegisterQtTypes ( )
static

Registers QML types.

Warning
You must invoke this before usage QML names provided by CAD Exchanger SDK.
Examples:
visualization/qtquick_qml/baseviewer/main.cxx.
void cadex::ModelPrsQtQuick_ViewPort::setCameraProjectionType ( CameraProjectionType  theType)

Sets camera projection type.

See also
cameraProjectionType()
void cadex::ModelPrsQtQuick_ViewPort::setGridPlaneEnabled ( bool  theEnabled)

Sets grid plane enabled.

See also
gridPlaneEnabled()
void cadex::ModelPrsQtQuick_ViewPort::setHighlightEnabled ( bool  theEnabled)

Sets highlight enabled.

See also
highlightEnabled
void cadex::ModelPrsQtQuick_ViewPort::setMouseMode ( MouseMode  theMode)

Sets mouse mode.

It allows to activate fit area mode which changes a behaviour of mouse events.

void cadex::ModelPrsQtQuick_ViewPort::setSelectionEnabled ( bool  theEnabled)

Sets selection enabled.

See also
selectionEnabled()
void cadex::ModelPrsQtQuick_ViewPort::setTrihedronEnabled ( bool  theEnabled)

Sets global trihedron enabled.

See also
trihedronEnabledChanged()
void cadex::ModelPrsQtQuick_ViewPort::setViewCubeEnabled ( bool  theEnabled)

Sets view cube enabled.

See also
viewCubeEnabled()
void cadex::ModelPrsQtQuick_ViewPort::setViewCubeGeometry ( const QRect &  theRect)

Sets view cube geometry.

See also
viewCubeGeometry()

Property Documentation

QObject * cadex::ModelPrsQtQuick_ViewPort::backgroundStyle
readwrite

Background style property.

See also
ModelPrsQtQuick_BackgroundStyle, BackgroundStyle()
ModelPrsQtQuick_ViewPort::CameraProjectionType cadex::ModelPrsQtQuick_ViewPort::cameraProjectionType
readwrite

Camera projection type property.

bool cadex::ModelPrsQtQuick_ViewPort::gridPlaneEnabled
readwrite

Grid plane enabled property.

bool cadex::ModelPrsQtQuick_ViewPort::highlightEnabled
readwrite

Highlight enabled property.

ModelPrsQtQuick_ViewPort::MouseMode cadex::ModelPrsQtQuick_ViewPort::mouseMode
readwrite

Mouse mode property.

bool cadex::ModelPrsQtQuick_ViewPort::selectionEnabled
readwrite

Selection enabled property.

bool cadex::ModelPrsQtQuick_ViewPort::trihedronEnabled
readwrite

Trihedron enabled property.

bool cadex::ModelPrsQtQuick_ViewPort::viewCubeEnabled
readwrite

View cube enabled property.

QRect cadex::ModelPrsQtQuick_ViewPort::viewCubeGeometry
readwrite

View cube geometry property.

QObject * cadex::ModelPrsQtQuick_ViewPort::viewCubeStyle
readwrite

View cube style property.

See also
ModelPrsQtQuick_ViewCubeStyle, ViewCubeStyle()