cee::vis::Model Class Referenceabstract

Model holds information which is to be gathered to constitute a view. More...

Public Member Functions

 Model ()
 Constructs an empty model. More...
 
Str name () const
 Returns the name of the model. More...
 
void setName (const Str &name)
 Sets the name of the model. More...
 
bool use2dPixelProjection () const
 Returns true if the model is using a 2D pixel exact projection to render its content. More...
 
void setUse2dPixelProjection (bool use2dMode)
 Specify if this model should use an override camera to render 2D sceen aligned data. More...
 
virtual BoundingBox boundingBox ()=0
 Returns the model's bounding box. More...
 
virtual Str modelInfo () const
 Returns model info. More...
 
- Public Member Functions inherited from cee::RefCountedObject
void addRef () const
 Increments the reference count for this object. More...
 
void release () const
 Decrements the reference count for this object. More...
 
int refCount () const
 Returns the reference count for this object. More...
 
void setRefCountZero () const
 Sets the ref count to zero, but DOES NOT delete the object. More...
 

Protected Types

enum  NotifyAction { NO_ACTION, MODEL_CHANGED }
 Notification sent to the view. More...
 

Protected Member Functions

void notifyObservingViews (NotifyAction notifyAction, const View *exceptView)
 Sends a notification to all observing views. More...
 
bool hasAnyObservingViewsWithClipping (bool *outExplicitViewClippingIsActive=NULL, bool *outDropShadowClippingIsActive=NULL) const
 Returns true if the model is a being viewed in any views where clipping is enabled (either view clipping or shadow clipping) More...
 
Inheritance diagram for cee::vis::Model:
cee::RefCountedObject cee::geo::GeometryModel cee::ug::UnstructGridModel cee::vis::MarkupModel cee::vis::BoxLocator cee::vis::PlaneLocator

Detailed Description

Model holds information which is to be gathered to constitute a view.

Ceetron Desktop Components offers several types of models. Model is the base class of all model types. UnstructGridModel is a subclass of Model which adds specific model structure and functionality for representing scientific and engineering models, e.g. finite element data. Other model types are MarkupModel and GeometryModel.

Each view can contain one or more models. See the model topic for more information.

Tutorials
UnstructGrid: Load model from file and set up model specification
UnstructGrid: Simple model with two triangles
Geometry: Create a geometry model

Member Enumeration Documentation

Notification sent to the view.

Enumerator
NO_ACTION 

No update needed. The viewer are not update.

MODEL_CHANGED 

The Model was changed. The view(s) showing this model will be updated accordingly.

Constructor & Destructor Documentation

cee::vis::Model::Model ( )

Constructs an empty model.

Member Function Documentation

virtual BoundingBox cee::vis::Model::boundingBox ( )
pure virtual

Returns the model's bounding box.

Implemented in cee::ug::UnstructGridModel, cee::vis::MarkupModel, and cee::geo::GeometryModel.

bool cee::vis::Model::hasAnyObservingViewsWithClipping ( bool *  outExplicitViewClippingIsActive = NULL,
bool *  outDropShadowClippingIsActive = NULL 
) const
protected

Returns true if the model is a being viewed in any views where clipping is enabled (either view clipping or shadow clipping)

Str cee::vis::Model::modelInfo ( ) const
virtual

Returns model info.

Reimplemented in cee::ug::UnstructGridModel, cee::vis::MarkupModel, and cee::geo::GeometryModel.

cee::Str cee::vis::Model::name ( ) const

Returns the name of the model.

See also
setName
void cee::vis::Model::notifyObservingViews ( NotifyAction  notifyAction,
const View exceptView 
)
protected

Sends a notification to all observing views.

void cee::vis::Model::setName ( const Str name)

Sets the name of the model.

The name of the model is not used by Ceetron Desktop Components, but can be used by the user to track and debug applications with lots of models.

void cee::vis::Model::setUse2dPixelProjection ( bool  use2dMode)

Specify if this model should use an override camera to render 2D sceen aligned data.

Use this method to enable 2D rendering of items from the MarkupModel and the Geometry model. The items will be fixed in the specified coordinates on the screen and will not change if the user modifies the camera by panning, rotating or zooming.

If enabled, all items in the model will be rendered in an Orthographic projection with the viewport setup to match the screen (OpenGL based) coordinates of the host window. The items in the model will be rendered on top of all other contents of the view, but it is still possible to use the z buffer for ordering within the models with this option enabled.

The x and y coordinate of the cee::Vec3d will be screen coordinates (OpenGL based window coordinates with lower left as origin) and the z coordinate will be used to determine which object to be visible if they overlap. The one with the largest z coordinate will win and be shown.

bool cee::vis::Model::use2dPixelProjection ( ) const

Returns true if the model is using a 2D pixel exact projection to render its content.

See also
setUse2dPixelProjection