Contains a list of points and geometric primitives. More...
Classes | |
struct | Cache |
Public Types | |
enum | GeoFlags { DEFAULT, NO_RAY_CAST, POLYGON_OFFSET } |
typedef RefCountedPtr< DrawLists > | DrawListsPtr |
Public Member Functions | |
GeoInfo () | |
void | copy (const GeoInfo *b) |
void | validate () |
Get primitives and attributes ready for display/rendering. | |
void | update_bbox () |
Calculate axis-aligned bounding box. | |
bool | ignoreForRayCasting () const |
void | setGeoInfoFlag (unsigned int flags) |
void | clearGeoInfoFlag (unsigned int flags) |
const Primitive * | primitive (unsigned n) const |
const Box3 & | bbox () const |
unsigned | output_index () const |
unsigned | primitives () const |
const Primitive ** | primitive_array () const |
unsigned | vertices () const |
unsigned | points () const |
const PointList * | point_list () const |
const Vector3 * | point_array () const |
DrawListsPtr | callLists () const |
const Cache * | get_cache_pointer () const |
void | setVertexCount (int vertices) |
const Hash & | src_id () const |
const Hash & | out_id () const |
void | set_out_id (DD::Image::Hash newId) |
unsigned | size (int group) const |
const Attribute * | get_attribute (const char *name) const |
const Attribute * | get_typed_attribute (const char *name, int type) const |
const Attribute * | get_group_attribute (int group, const char *name) const |
const Attribute * | get_typed_group_attribute (int group, const char *name, int type) const |
int | get_attribcontext_count () const |
const AttribContext * | get_attribcontext (int index) const |
const AttribContext * | get_attribcontext (const char *name) const |
const AttribContext * | get_typed_attribcontext (const char *name, int type) const |
const AttribContext * | get_group_attribcontext (int group, const char *name) const |
const AttribContext * | get_typed_group_attribcontext (int group, const char *name, int type) const |
void | delete_group_attribute (int group, const char *name, int type=INVALID_ATTRIB) |
PrimitiveContext * | getPrimitiveContext () |
bool | construct_normals (int group, Attribute *, float threshold=0.0f) const |
bool | orient_normals (int group, Attribute *, const Vector3 &P, bool invert=false) const |
void | draw (ViewerContext *) |
void | draw_icons (ViewerContext *) |
void | draw_bbox (ViewerContext *) |
bool | draw_wireframe (ViewerContext *) |
bool | draw_solid (ViewerContext *) |
bool | draw_pick_ids (ViewerContext *ctx, unsigned int offset) |
bool | draw_selectable_items (ViewerContext *ctx) |
bool | draw_selected_items (ViewerContext *ctx, const GeoSelection &selection) |
void | print_info (std::ostream &o) |
void | trash_display_list (bool trash=true) |
void | trash_selected_display_list () |
Box3 | getTransformedBBox () |
Public Attributes | |
Matrix4 | matrix |
Transformation matrix. | |
Iop * | material |
Overall material assignment. | |
bool | useMaterialContext |
Use OutputContext with material. | |
DD::Image::OutputContext | materialContext |
OutputContext for material. | |
RenderMode | render_mode |
Turn Render output on/off. | |
Display3DMode | display3d |
How to draw (see ViewerContext style3d) | |
bool | selected |
Draw with selected wireframe. | |
bool | selectable |
Object can be selected. | |
GeoInfoRenderState | renderState |
GeoOp * | source_geo |
Last non-merge GeoOp. | |
GeoOp * | final_geo |
Last GeoOp before a merge. | |
GeoOp * | select_geo |
Last selectable GeoOp. | |
GeoOp * | recursion_geo |
GeoOp which started a recursing loop. | |
bool | valid_source_node_gl_color |
true if gl node color is valid | |
unsigned | source_node_gl_color |
Source gl node color for drawing. | |
const AttribContext * | UV_ref |
Reference to the primary UV. | |
const AttribContext * | N_ref |
Reference to the primary normal. | |
const AttribContext * | Cf_ref |
Reference to the primary surface color. | |
const AttribContext * | PW_ref |
Reference to the world-space point. | |
const AttribContext * | VEL_ref |
Reference to the point velocity. | |
Attribute * | selections [Group_Last] |
Group selection attributes. | |
unsigned | selected_items_list |
unsigned int | selected_items_IB |
unsigned int | selected_indices_count |
Friends | |
class | GeoOp |
class | GeometryList |
class | Primitive |
Contains a list of points and geometric primitives.
3D data is stored in a Scene object. The Scene contains a vector of these, each one describes a single geometric object that is shaded with a single set of shaders and transformed by a single matrix.
DD::Image::GeoInfo::GeoInfo | ( | ) |
Constructor clears all the geometry lists and nulls the materials.
void DD::Image::GeoInfo::copy | ( | const GeoInfo * | b | ) |
Point data is duplicated and every primitive is copied.
void DD::Image::GeoInfo::validate | ( | ) |
Get primitives and attributes ready for display/rendering.
Append another GeoInfo's geometry into this one. Point data is duplicated and every primitive is copied.
Re-assign the standard attribute references from the current list.
Referenced by DD::Image::GeoOp::build_scene(), DD::Image::Scene::generate_render_primitives(), DD::Image::ModifyGeo::geometry_engine(), and DD::Image::Scene::validate().
void DD::Image::GeoInfo::update_bbox | ( | ) |
Calculate axis-aligned bounding box.
Get the GeoInfo's bounding-box up-to-date by finding a bounding volume that fits around all points. Alternate bounding geometry such as spheres can be calculated at this time. Produces bounding-box by adding each point to the local bounding box.
const Primitive* DD::Image::GeoInfo::primitive | ( | unsigned | n | ) | const [inline] |
Get primitive.
void DD::Image::GeoInfo::setVertexCount | ( | int | vertices | ) | [inline] |
Allows cache vertex count to be manually overridden to keep attributes in sync with primitives. Some Primitive types do not have vertex counts that can be predicted at the moment the primitive is added to the GeoInfo leading to a difference in total vertex count causing vertex Attributes to have incorrect sizes.
const Hash& DD::Image::GeoInfo::src_id | ( | ) | const [inline] |
Return the object ids.
unsigned DD::Image::GeoInfo::size | ( | int | group | ) | const |
Returns the size of the group list.
const Attribute* DD::Image::GeoInfo::get_attribute | ( | const char * | name | ) | const |
const Attribute* DD::Image::GeoInfo::get_typed_attribute | ( | const char * | name, |
int | type | ||
) | const |
Search for an attribute by name and type, returning its pointer if found.
const Attribute* DD::Image::GeoInfo::get_group_attribute | ( | int | group, |
const char * | name | ||
) | const |
Search for an attribute by name and group, returning its pointer if found.
Referenced by DD::Image::Render::_request().
const Attribute* DD::Image::GeoInfo::get_typed_group_attribute | ( | int | group, |
const char * | name, | ||
int | type | ||
) | const |
Search for an attribute by name, group and type, returning its pointer if found.
const AttribContext* DD::Image::GeoInfo::get_attribcontext | ( | const char * | name | ) | const |
Find a valid attribute by name at each level of possible assignment in this order of importance: Vertex, Point, Material, Primitive, then Object. If found return a pointer to the AttribContext structure which has the attribute pointer and it's group info.
const AttribContext* DD::Image::GeoInfo::get_typed_attribcontext | ( | const char * | name, |
int | type | ||
) | const |
Search for an attribute by name and type and return a const reference to it if found.
const AttribContext* DD::Image::GeoInfo::get_group_attribcontext | ( | int | group, |
const char * | name | ||
) | const |
Search for an attribute by name and group and return a const reference to it if found.
const AttribContext* DD::Image::GeoInfo::get_typed_group_attribcontext | ( | int | group, |
const char * | name, | ||
int | type | ||
) | const |
Search for an attribute by name, group and type, returning its pointer if found.
void DD::Image::GeoInfo::delete_group_attribute | ( | int | group, |
const char * | name, | ||
int | type = INVALID_ATTRIB |
||
) |
Clears the reference pointer to the attribute, effectively deleting it.
bool DD::Image::GeoInfo::orient_normals | ( | int | group, |
Attribute * | , | ||
const Vector3 & | P, | ||
bool | invert = false |
||
) | const |
Point the normals of the passed in attribute at point Pl. Returns true if successful.
void DD::Image::GeoInfo::draw | ( | ViewerContext * | ) |
Draw the GeoInfo's geometry in OpenGL.
void DD::Image::GeoInfo::draw_bbox | ( | ViewerContext * | ) |
Draw the surrounding bbox. This is drawn separately from the object primitives because the bbox has already been transformed by the matrix.
bool DD::Image::GeoInfo::draw_wireframe | ( | ViewerContext * | ) |
Draw wireframe of the object, by calling draw_wireframe on all the primitives. This compiles an OpenGL call list, which is reused until invalidate() is called. Returns false if there is some problem creating the call list (though everything ignores this)
bool DD::Image::GeoInfo::draw_solid | ( | ViewerContext * | ) |
Draw shaded version the object, by calling draw_solid on all the primitives. This compiles an OpenGL call list, which is reused until invalidate() is called. Returns false if there is some problem creating the call list (though everything ignores this)
Referenced by DD::Image::Black::shade_GL().
bool DD::Image::GeoInfo::draw_pick_ids | ( | ViewerContext * | ctx, |
unsigned int | offset | ||
) |
Draw selectable parts of the object. This compiles an OpenGL call list, which is reused until invalidate() is called. Returns false if there is some problem creating the call list (though everything ignores this).
bool DD::Image::GeoInfo::draw_selected_items | ( | ViewerContext * | ctx, |
const GeoSelection & | selection | ||
) |
Draw selected parts of the object. This compiles an OpenGL call list, which is reused until invalidate() is called. Returns false if there is some problem creating the call list (though everything ignores this).
void DD::Image::GeoInfo::print_info | ( | std::ostream & | o | ) |
Primary use is to print GeoInfo information into Nuke's info box.
Referenced by DD::Image::GeoOp::print_info().
OpenGL call list management.
Referenced by DD::Image::GeoOp::build_scene().