Model used for drawing labels, arrows, lines, points, triangles and glyphs. More...
Public Member Functions | |
MarkupModel () | |
Creates empty markup model. More... | |
size_t | partCount () const |
Returns the number of parts in the model. More... | |
size_t | partIndex (MarkupPart *part) const |
Returns the index of the specified part. More... | |
MarkupPart * | part (size_t index) |
Returns the part at the given index. More... | |
const MarkupPart * | part (size_t index) const |
Returns a const pointer to the part at the given index. More... | |
void | addPart (MarkupPart *part) |
Adds the part to the model. More... | |
void | removePart (MarkupPart *part) |
Removes the specified part from the model. More... | |
void | removeAllParts () |
Removes all parts from the model. More... | |
virtual BoundingBox | boundingBox () |
Returns the current bounding box of the model. More... | |
virtual Str | modelInfo () const |
Returns information about the model. More... | |
size_t | rayIntersect (const Ray &ray, const View &view) |
Returns the index of the part hit by the ray. More... | |
bool | rayIntersect (const Ray &ray, const View &view, MarkupModelHitItem *hitItem) |
Performs a ray intersect on the parts in the model. More... | |
bool | rayIntersectAllHits (const Ray &ray, const View &view, MarkupModelHitItemCollection *hitItems) |
Performs a ray intersect on the parts in the model, returning all parts that was intersected by the ray. More... | |
bool | isViewClippingIgnored () const |
Returns true if this model is configured to ignore view clipping. More... | |
void | setIgnoreViewClipping (bool ignore) |
Set if view clipping should be ignored for all parts in this model. More... | |
![]() | |
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... | |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
enum | NotifyAction { NO_ACTION, MODEL_CHANGED } |
Notification sent to the view. More... | |
![]() | |
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... | |
Model used for drawing labels, arrows, lines, points, triangles and glyphs.
The MarkupModel enables the user to draw custom markup figures and texts into the model. The markup model can, for instance, be used to:
MarkupModel is a subclass of Model.
A View object has a collection of models. Add a model to the view with View::addModel().
The markup model has several drawing tools:
The markup model provides a rayIntersect() method to support picking or selection.
Reads and setup a model from file. Uses the values from the model's bounding box to draw a bounding box as a markup model. The markup model is drawn as yellow lines.
Create the markup model object.
Get the bounding box from the view and get all vertices in the box.
Add all the lines of the bounding box to the model.
Add the markup model to the view
See the complete source code here: Visualization: Draw bounding box using markup model
cee::vis::MarkupModel::MarkupModel | ( | ) |
Creates empty markup model.
void cee::vis::MarkupModel::addPart | ( | MarkupPart * | part | ) |
Adds the part to the model.
|
virtual |
Returns the current bounding box of the model.
Implements cee::vis::Model.
bool cee::vis::MarkupModel::isViewClippingIgnored | ( | ) | const |
Returns true if this model is configured to ignore view clipping.
|
virtual |
Returns information about the model.
Reimplemented from cee::vis::Model.
MarkupPart * cee::vis::MarkupModel::part | ( | size_t | index | ) |
Returns the part at the given index.
const MarkupPart * cee::vis::MarkupModel::part | ( | size_t | index | ) | const |
Returns a const pointer to the part at the given index.
size_t cee::vis::MarkupModel::partCount | ( | ) | const |
Returns the number of parts in the model.
size_t cee::vis::MarkupModel::partIndex | ( | MarkupPart * | part | ) | const |
Returns the index of the specified part.
Returns the index of the part hit by the ray.
Returns cee::UNDEFINED_SIZE_T if no hit.
bool cee::vis::MarkupModel::rayIntersect | ( | const Ray & | ray, |
const View & | view, | ||
MarkupModelHitItem * | hitItem | ||
) |
Performs a ray intersect on the parts in the model.
If there is a hit, the provided hitItem will be updated with the markup part details of the closest part
Returns false if no hit.
bool cee::vis::MarkupModel::rayIntersectAllHits | ( | const Ray & | ray, |
const View & | view, | ||
MarkupModelHitItemCollection * | hitItems | ||
) |
Performs a ray intersect on the parts in the model, returning all parts that was intersected by the ray.
If there is a hit, the provided hitItem collection will be updated with the all the hit parts.
Returns false if no hit.
void cee::vis::MarkupModel::removeAllParts | ( | ) |
Removes all parts from the model.
void cee::vis::MarkupModel::removePart | ( | MarkupPart * | part | ) |
Removes the specified part from the model.
void cee::vis::MarkupModel::setIgnoreViewClipping | ( | bool | ignore | ) |
Set if view clipping should be ignored for all parts in this model.
This will disable any clipping planes specified in the view for the this model