CGAL 4.12.2 - Three
|
#include <CGAL/Three/Scene_group_item.h>
A Scene_group_item is a special Scene_item that does not draw anything, but regroups other items as its children.
It allows the user to apply several actions to multiple items at the same time. A custom Scene_item can derive from it to have children. They appear hierarchically in the Geometric Objects list.
Public Slots | |
void | resetDraw () |
Redraws children. More... | |
![]() | |
virtual void | invalidateOpenGLBuffers () |
Notifies the program that the internal data or the properties of an item has changed, and that it must be computed again. More... | |
void | setRbgColor (int r, int g, int b) |
Setter for the RGB color of the item. More... | |
virtual void | setName (QString n) |
Sets the name of the item. | |
virtual void | moveToGroup (Scene_group_item *group) |
Set the parent group. More... | |
void | setPointsMode () |
Sets the RenderingMode to Points. | |
void | setShadedPointsMode () |
Sets the RenderingMode to Points. | |
void | setWireframeMode () |
Sets the RenderingMode to Wireframe. | |
void | setFlatMode () |
Sets the RenderingMode to Flat. | |
void | setFlatPlusEdgesMode () |
Set the RenderingMode to FlatPlusEdges. | |
void | setGouraudMode () |
Sets the RenderingMode to Gouraud. | |
void | setPointsPlusNormalsMode () |
Sets the RenderingMode to PointsPlusNormals. | |
virtual void | itemAboutToBeDestroyed (Scene_item *) |
Emits an aboutToBeDestroyed() signal. More... | |
virtual void | select (double orig_x, double orig_y, double orig_z, double dir_x, double dir_y, double dir_z) |
Selects a point through raycasting. | |
Public Member Functions | |
void | setScene (Scene_interface *s) |
Sets the scene;. | |
bool | isFinite () const |
Returns false to avoid disturbing the BBox of the scene. | |
bool | isEmpty () const |
Returns true to avoid disturbing the BBox of the scene. | |
void | lockChild (CGAL::Three::Scene_item *) |
Locks a child. More... | |
void | unlockChild (CGAL::Three::Scene_item *) |
Unlocks a child. More... | |
bool | isChildLocked (CGAL::Three::Scene_item *) |
Tells if a child is locked. More... | |
bool | isExpanded () const |
Returns if the group_item is currently expanded or collapsed in the Geometric Objects list. More... | |
void | setExpanded (bool) |
Makes the group_item expanded or collapsed in the view. More... | |
Bbox | bbox () const |
Returns an empty Bbox to avoid disturbing the Bbox of the scene. | |
Scene_item * | clone () const |
Not supported. | |
bool | supportsRenderingMode (RenderingMode m) const |
Indicates if the rendering mode is supported. More... | |
QString | toolTip () const |
void | addChild (Scene_item *new_item) |
Adds a CGAL::Three::Scene_item* to the list of children. More... | |
void | setColor (QColor c) |
Sets all the children to the specified color. | |
void | setRenderingMode (RenderingMode m) |
Sets all the children in the specified rendering mode. | |
void | setVisible (bool b) |
Sets all the children to the specified visibility. | |
void | setPointsMode () |
Sets all the children in points mode. | |
void | setWireframeMode () |
Sets all the children in wireframe rendering. | |
void | setWireframe () |
Sets all the children in wireframe rendering. | |
void | setFlat () |
Sets all the children in flat rendering. | |
void | setFlatMode () |
Sets all the children in flat rendering. | |
void | setFlatPlusEdgesMode () |
Sets all the children in flat rendering with edges. | |
void | setGouraudMode () |
Sets all the children in smooth rendering. | |
void | setPointsPlusNormalsMode () |
Sets all the children in point rendering with normals. | |
QList< Scene_item * > | getChildren () const |
Returns a list of all the direct children. More... | |
virtual QList< Scene_item * > | getChildrenForSelection () const |
getChildrenForSelection returns the list of children to select along with the group. More... | |
void | removeChild (Scene_item *item) |
Removes a Scene_item from the list of children. More... | |
void | moveUp (int) |
Moves a child up in the list. | |
void | moveDown (int) |
Moves a child down in the list. | |
![]() | |
Scene_item (int buffers_size=20, int vaos_size=10) | |
The Constructor. More... | |
void | setNbIsolatedvertices (std::size_t nb) |
Sets the number of isolated vertices. More... | |
std::size_t | getNbIsolatedvertices () const |
Getter for the number of isolated vertices. More... | |
virtual void | draw () const |
Deprecated. Does nothing. | |
virtual void | drawEdges () const |
Deprecated. Does nothing. | |
virtual void | drawPoints () const |
Deprecated. Does nothing. | |
virtual void | selection_changed (bool b) |
Called by the scene. If b is true, then this item is currently selected. | |
virtual QPixmap | graphicalToolTip () const |
Contains graphical meta-data about the item. More... | |
virtual QFont | font () const |
Contains the font used for the data of the item. More... | |
virtual double | diagonalBbox () const |
the item's bounding box's diagonal length. More... | |
virtual bool | manipulatable () const |
Returns true if the item has a ManipulatedFrame. More... | |
virtual ManipulatedFrame * | manipulatedFrame () |
The manipulatedFrame of the item. More... | |
virtual QColor | color () const |
Getter for the item's color. More... | |
virtual QString | name () const |
Getter for the item's name. More... | |
virtual bool | visible () const |
If the item is not visible, it is not drawn and its Bbox is ignored in the computation of the scene's. More... | |
virtual RenderingMode | renderingMode () const |
Getter for the item's rendering mode. More... | |
virtual QString | renderingModeName () const |
The renderingMode's name. More... | |
virtual QMenu * | contextMenu () |
Context menu. More... | |
virtual bool | keyPressEvent (QKeyEvent *) |
Handles key press events. | |
Scene_group_item * | parentGroup () const |
The group containing the item. More... | |
virtual Header_data | header () const |
Returns a Header_data struct containing the header information. | |
virtual bool | has_stats () const |
Returns true if the item has statistics. | |
virtual QString | computeStats (int i) |
Returns a QString containing the requested value for the the table in the statistics dialog. More... | |
Protected Attributes | |
QList< Scene_item * > | children |
Contains a reference to all the children of this group. | |
![]() | |
Bbox | _bbox |
Holds the BBox of the item. | |
QString | name_ |
The name of the item. | |
QColor | color_ |
The color of the item. | |
bool | visible_ |
The visibility of the item. | |
Scene_group_item * | parent_group |
The parent group, or 0 if the item is not in a group. | |
bool | is_selected |
Specifies if the item is currently selected. | |
std::size_t | nb_isolated_vertices |
Holds the number of vertices that are not linked to the polyhedron from the OFF file. More... | |
bool | are_buffers_filled |
Decides if the draw function must call initializeBuffers() or not. More... | |
RenderingMode | rendering_mode |
The rendering mode of the item. More... | |
QMenu * | defaultContextMenu |
The default context menu. | |
RenderingMode | prev_shading |
Contains the previous RenderingMode. More... | |
RenderingMode | cur_shading |
Contains the current RenderingMode. More... | |
int | buffersSize |
Contains the size of the vector of VBOs. | |
int | vaosSize |
Contains the size of the map of VAOs. | |
std::vector< QOpenGLBuffer > | buffers |
Contains the VBOs. | |
std::vector< QOpenGLVertexArrayObject * > | vaos |
Contains the VAOs. | |
virtual void | draw (CGAL::Three::Viewer_interface *) const |
Draw functions Scene_group_item's children are not drawn by the scene, they are drawn by the group. More... | |
virtual void | drawEdges (CGAL::Three::Viewer_interface *) const |
draws all the children More... | |
virtual void | drawPoints (CGAL::Three::Viewer_interface *) const |
draws all the children More... | |
Additional Inherited Members | |
![]() | |
enum | OpenGL_program_IDs { , PROGRAM_WITHOUT_LIGHT, PROGRAM_NO_SELECTION, PROGRAM_WITH_TEXTURE, PROGRAM_PLANE_TWO_FACES, PROGRAM_WITH_TEXTURED_EDGES, PROGRAM_INSTANCED, PROGRAM_INSTANCED_WIRE, PROGRAM_C3T3, PROGRAM_C3T3_EDGES, PROGRAM_CUTPLANE_SPHERES, PROGRAM_SPHERES, PROGRAM_FLAT, PROGRAM_OLD_FLAT, NB_OF_PROGRAMS } |
The OpenGL_program_IDs enum. More... | |
![]() | |
void | itemChanged () |
Is emitted to notify a change in the item's data. | |
void | itemVisibilityChanged () |
Is emitted when the item is shown to notify a change in the item's visibility. More... | |
void | aboutToBeDestroyed () |
Is emitted to notify that the item is about to be deleted. | |
void | redraw () |
Is emitted to require a new display. | |
![]() | |
int | has_group |
Contains the number of group and subgroups containing this item. | |
![]() | |
static const QColor | defaultColor |
The default color of a scene_item. More... | |
![]() | |
void | addVaos (int i) |
Adds a VAO to the Map. | |
void | initializeBuffers () |
Fills the VBOs with data. More... | |
void | computeElements () |
Collects all the data for the shaders. More... | |
void | attribBuffers (CGAL::Three::Viewer_interface *, int program_name) const |
Passes all the uniform data to the shaders. More... | |
virtual QOpenGLShaderProgram * | getShaderProgram (int name, CGAL::Three::Viewer_interface *viewer=0) const |
Compatibility function. More... | |
void CGAL::Three::Scene_group_item::addChild | ( | Scene_item * | new_item | ) |
Adds a CGAL::Three::Scene_item* to the list of children.
|
virtual |
Draw functions Scene_group_item's children are not drawn by the scene, they are drawn by the group.
draws all the children
Calls Scene_item::draw()
, then calls Scene_item::drawEdges()
and Scene_item::drawPoints
for each child if its current rendering mode is adequat.
Reimplemented from CGAL::Three::Scene_item.
|
virtual |
draws all the children
Calls Scene_item::drawEdges()
, then calls Scene_item::draw()
and Scene_item::drawPoints
for each child if its current rendering mode is adequat.
Reimplemented from CGAL::Three::Scene_item.
|
virtual |
draws all the children
Calls Scene_item::drawPoints()
, then calls Scene_item::draw()
and Scene_item::drawEdges()
for each child if its current rendering mode is adequat.
Reimplemented from CGAL::Three::Scene_item.
QList<Scene_item*> CGAL::Three::Scene_group_item::getChildren | ( | ) | const |
Returns a list of all the direct children.
Only returns children that have this item as a parent. Children of these children are not returned.
|
virtual |
getChildrenForSelection returns the list of children to select along with the group.
When a Scene_group_item
is added to the selection of the scene, this function defines which of its children will be added too. Typically overriden to allow applying an operation from the Operation menu only to the parent item and not to its children.
bool CGAL::Three::Scene_group_item::isChildLocked | ( | CGAL::Three::Scene_item * | ) |
bool CGAL::Three::Scene_group_item::isExpanded | ( | ) | const |
Returns if the group_item is currently expanded or collapsed in the Geometric Objects list.
True means expanded, false means collapsed.
void CGAL::Three::Scene_group_item::lockChild | ( | CGAL::Three::Scene_item * | ) |
Locks a child.
A locked child cannot be moved out of the group nor can it be deleted. Use it to prevent a child to be destroyed without its parent.
void CGAL::Three::Scene_group_item::removeChild | ( | Scene_item * | item | ) |
Removes a Scene_item from the list of children.
|
slot |
Redraws children.
As each drawing function of a group draws all parts of its children, once any of these functions is called, we skip all drawing calls until resetDraw()
is called. This keeps children from being drawn several times. It is automatically called at the end of the scene's draw()
function.
void CGAL::Three::Scene_group_item::setExpanded | ( | bool | ) |
Makes the group_item expanded or collapsed in the view.
True means expanded, false means collapsed.
|
virtual |
Indicates if the rendering mode is supported.
Implements CGAL::Three::Scene_item.
|
virtual |
Implements CGAL::Three::Scene_item.
void CGAL::Three::Scene_group_item::unlockChild | ( | CGAL::Three::Scene_item * | ) |
Unlocks a child.