Nuke binary plugins 15.0.5
 
Loading...
Searching...
No Matches
DD::Image::GeoInfo Class Reference

Contains a list of points and geometric primitives. More...

#include <GeoInfo.h>

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 ()
 
void update_bbox ()
 Calculate axis-aligned bounding box.
 
bool ignoreForRayCasting () const
 
void setGeoInfoFlag (unsigned int flags)
 
void clearGeoInfoFlag (unsigned int flags)
 
const Primitiveprimitive (unsigned n) const
 
const Box3bbox () const
 
unsigned output_index () const
 
unsigned primitives () const
 
const Primitive ** primitive_array () const
 
unsigned vertices () const
 
unsigned points () const
 
const PointListpoint_list () const
 
const Vector3point_array () const
 
DrawListsPtr callLists () const
 
const Cacheget_cache_pointer () const
 
void setVertexCount (int vertices)
 
const Hashsrc_id () const
 
const Hashout_id () const
 
void set_out_id (DD::Image::Hash newId)
 
unsigned size (int group) const
 
const Attributeget_attribute (const char *name) const
 
const Attributeget_typed_attribute (const char *name, int type) const
 
const Attributeget_group_attribute (int group, const char *name) const
 
const Attributeget_typed_group_attribute (int group, const char *name, int type) const
 
int get_attribcontext_count () const
 
const AttribContextget_attribcontext (int index) const
 
const AttribContextget_attribcontext (const char *name) const
 
const AttribContextget_typed_attribcontext (const char *name, int type) const
 
const AttribContextget_group_attribcontext (int group, const char *name) const
 
const AttribContextget_typed_group_attribcontext (int group, const char *name, int type) const
 
void delete_group_attribute (int group, const char *name, int type=INVALID_ATTRIB)
 
PrimitiveContextgetPrimitiveContext ()
 
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.
 
Iopmaterial
 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
 
GeoOpsource_geo
 Last non-merge GeoOp.
 
GeoOpfinal_geo
 Last GeoOp before a merge.
 
GeoOpselect_geo
 Last selectable GeoOp.
 
GeoOprecursion_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 AttribContextUV_ref
 Reference to the primary UV.
 
const AttribContextN_ref
 Reference to the primary normal.
 
const AttribContextCf_ref
 Reference to the primary surface color.
 
const AttribContextPW_ref
 Reference to the world-space point.
 
const AttribContextVEL_ref
 Reference to the point velocity.
 
Attributeselections [Group_Last]
 Group selection attributes.
 
unsigned selected_items_list
 
unsigned int selected_items_IB
 
unsigned int selected_items_CB
 
unsigned int selected_indices_count
 

Friends

class GeoOp
 
class GeometryList
 
class Primitive
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ GeoInfo()

DD::Image::GeoInfo::GeoInfo ( )

Constructor clears all the geometry lists and nulls the materials.

Member Function Documentation

◆ copy()

void DD::Image::GeoInfo::copy ( const GeoInfo b)

Point data is duplicated and a shallow copy of primitive data is made.

◆ validate()

void DD::Image::GeoInfo::validate ( )

Append another GeoInfo's geometry into this one. Point data is duplicated and every primitive is copied. ‍/ void append(const GeoInfo &b);

! Get primitives and attributes ready for display/rendering. /*! 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().

◆ update_bbox()

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.

◆ primitive()

const Primitive * DD::Image::GeoInfo::primitive ( unsigned  n) const
inline

Get primitive.

◆ setVertexCount()

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.

◆ src_id()

const Hash & DD::Image::GeoInfo::src_id ( ) const
inline

Return the object ids.

◆ size()

unsigned DD::Image::GeoInfo::size ( int  group) const

Returns the size of the group list.

◆ get_attribute()

const Attribute * DD::Image::GeoInfo::get_attribute ( 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 Attribute, otherwise NULL.

◆ get_typed_attribute()

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.

◆ get_group_attribute()

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.

◆ get_typed_group_attribute()

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.

◆ get_attribcontext()

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.

◆ get_typed_attribcontext()

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.

◆ get_group_attribcontext()

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.

◆ get_typed_group_attribcontext()

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.

◆ delete_group_attribute()

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.

◆ orient_normals()

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.

◆ draw()

void DD::Image::GeoInfo::draw ( ViewerContext )

Draw the GeoInfo's geometry in OpenGL.

◆ draw_bbox()

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.

◆ draw_wireframe()

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)

◆ draw_solid()

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)

◆ draw_pick_ids()

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).

◆ draw_selected_items()

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).

◆ print_info()

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().

Member Data Documentation

◆ selected_items_list

unsigned DD::Image::GeoInfo::selected_items_list

OpenGL call list management.

Referenced by DD::Image::GeoOp::build_scene().



©2024 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com