Panda3D
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | Protected Attributes

EggNurbsSurface Class Reference

A parametric NURBS surface. More...

#include "eggNurbsSurface.h"

Inheritance diagram for EggNurbsSurface:
EggSurface EggPrimitive EggNode EggAttributes EggRenderMode EggNamedObject EggObject Namable TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase

List of all members.

Public Types

enum  AlphaMode {
  AM_unspecified, AM_off, AM_on, AM_blend,
  AM_blend_no_occlude, AM_ms, AM_ms_mask, AM_binary,
  AM_dual
}
typedef Vertices::const_iterator const_iterator
typedef Vertices::const_pointer const_pointer
typedef Vertices::const_reference const_reference
typedef
Vertices::const_reverse_iterator 
const_reverse_iterator
typedef plist< PT(EggNurbsCurve) > Curves
enum  DepthTestMode { DTM_unspecified, DTM_off, DTM_on }
enum  DepthWriteMode { DWM_unspecified, DWM_off, DWM_on }
typedef Vertices::difference_type difference_type
typedef Vertices::const_iterator iterator
typedef Curves Loop
typedef plist< Loop > Loops
typedef Vertices::const_pointer pointer
typedef Vertices::const_reference reference
typedef
Vertices::const_reverse_iterator 
reverse_iterator
enum  Shading { S_unknown, S_overall, S_per_face, S_per_vertex }
typedef Vertices::size_type size_type
typedef Loops Trim
typedef plist< Trim > Trims
enum  VisibilityMode { VM_unspecified, VM_hidden, VM_normal }

Public Member Functions

 EggNurbsSurface (const string &name="")
 EggNurbsSurface (const EggNurbsSurface &copy)
void add_texture (EggTexture *texture)
 Applies the indicated texture to the primitive.
EggVertexadd_vertex (EggVertex *vertex)
 Adds the indicated vertex to the end of the primitive's list of vertices, and returns it.
virtual void apply_first_attribute ()
 Sets the first vertex of the triangle (or each component) to the primitive normal and/or color, if the primitive is flat-shaded.
virtual void apply_last_attribute ()
 Sets the last vertex of the triangle (or each component) to the primitive normal and/or color, if the primitive is flat-shaded.
void apply_texmats ()
 Applies the texture matrices to the UV's of the vertices that reference them, and then removes the texture matrices from the textures themselves.
virtual EggTransformas_transform ()
 Returns this object cross-cast to an EggTransform pointer, if it inherits from EggTransform, or NULL if it does not.
TypedObjectas_typed_object ()
 Returns the object, upcast (if necessary) to a TypedObject pointer.
const TypedObjectas_typed_object () const
 Returns the object, upcast (if necessary) to a TypedObject pointer.
iterator begin () const
virtual bool cleanup ()
 Cleans up modeling errors in whatever context this makes sense.
void clear ()
 Removes all of the vertices from the primitive.
void clear_bin ()
 Removes the bin name that was set for this particular object.
void clear_color ()
void clear_connected_shading ()
 Resets the connected_shading member in this primitive, so that get_connected_shading() will recompute a new value.
void clear_depth_offset ()
 Removes the depth-offset flag from this particular object.
void clear_draw_order ()
 Removes the draw-order flag from this particular object.
void clear_material ()
 Removes any material from the primitive.
void clear_name ()
 Resets the Namable's name to empty.
void clear_normal ()
void clear_texture ()
 Removes any texturing from the primitive.
void clear_user_data ()
 Removes *all* user data pointers from the node.
void clear_user_data (TypeHandle type)
 Removes the user data pointer of the indicated type.
int compare_to (const EggAttributes &other) const
 An ordering operator to compare two vertices for sorting order.
void copy_attributes (const EggAttributes &other)
 Copies the rendering attributes from the indicated primitive.
void copy_attributes (const EggPrimitive &other)
 Copies the rendering attributes from the indicated primitive.
void copy_color (const EggAttributes &other)
 Sets this color to be the same as the other's, include morphs.
void copy_normal (const EggAttributes &other)
 Sets this normal to be the same as the other's, include morphs.
void copy_vertices (const EggPrimitive &other)
 Replaces the current primitive's list of vertices with a copy of the list of vertices on the other primitive.
virtual EggRenderModedetermine_alpha_mode ()
 Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this primitive that has an alpha_mode other than AM_unspecified.
virtual EggRenderModedetermine_bin ()
 Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this primitive that has a bin specified.
virtual bool determine_decal ()
 Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "decal" flag set.
virtual EggRenderModedetermine_depth_offset ()
 Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this primitive that has a depth_offset specified.
virtual EggRenderModedetermine_depth_test_mode ()
 Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a depth_test_mode other than DTM_unspecified.
virtual EggRenderModedetermine_depth_write_mode ()
 Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a depth_write_mode other than DWM_unspecified.
virtual EggRenderModedetermine_draw_order ()
 Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this primitive that has a draw_order specified.
virtual bool determine_indexed ()
 Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "indexed" scalar set.
virtual EggRenderModedetermine_visibility_mode ()
 Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a visibility_mode other than VM_unspecified.
bool empty () const
iterator end () const
iterator erase (iterator position)
iterator erase (iterator first, iterator last)
 Part of the implementaion of the EggPrimitive as an STL container.
iterator find (EggVertex *vertex)
 Returns the iterator pointing to the indicated vertex, or end() if the vertex is not part of the primitive.
void flatten_transforms ()
 Removes any transform and instance records from this node in the scene graph and below.
virtual TypeHandle force_init_type ()
AlphaMode get_alpha_mode () const
 Returns the alpha mode that was set, or AM_unspecified if nothing was set.
int get_best_parent_from_Set (const std::set< int > &) const
bool get_bface_flag () const
 Retrieves the backfacing flag of the polygon.
string get_bin () const
 Returns the bin name that has been set for this particular object, if any.
Colorf get_color () const
 Returns the color set on this particular attribute.
Shading get_connected_shading () const
 Determines what sort of shading properties this primitive's connected neighbors have.
EggVertexget_cv (int ui, int vi) const
 Returns the control vertex at the indicate U, V position.
int get_depth () const
 Returns the number of nodes above this node in the egg hierarchy.
int get_depth_offset () const
 Returns the "depth-offset" flag as set for this particular object.
DepthTestMode get_depth_test_mode () const
 Returns the depth_test mode that was set, or DTM_unspecified if nothing was set.
DepthWriteMode get_depth_write_mode () const
 Returns the depth_write mode that was set, or DWM_unspecified if nothing was set.
int get_draw_order () const
 Returns the "draw-order" flag as set for this particular object.
EggMaterialget_material () const
 Returns a pointer to the applied material, or NULL if there is no material applied.
const string & get_name () const
const LMatrix4dget_node_frame () const
 Returns the coordinate frame of the node itself.
const LMatrix4dget_node_frame_inv () const
 Returns the inverse of the matrix returned by get_node_frame().
const LMatrix4dget_node_frame_inv_ptr () const
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_frame_inv() matrix.
const LMatrix4dget_node_frame_ptr () const
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_frame() matrix.
const LMatrix4dget_node_to_vertex () const
 Returns the transformation matrix suitable for converting vertices in the coordinate space of the node to the appropriate coordinate space for storing in the egg file.
const LMatrix4dget_node_to_vertex_ptr () const
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_to_vertex() matrix.
const Normaldget_normal () const
int get_num_cvs () const
 Returns the total number of control vertices that should* be defined for the surface.
int get_num_textures () const
 Returns the number of textures applied to the primitive.
int get_num_u_cvs () const
 Returns the number of control vertices that should be present in the U direction.
int get_num_u_knots () const
 Returns the number of knots in the U direction.
int get_num_v_cvs () const
 Returns the number of control vertices that should be present in the V direction.
int get_num_v_knots () const
 Returns the number of knots in the V direction.
int get_num_vertices () const
EggGroupNodeget_parent () const
EggVertexPoolget_pool () const
 Returns the vertex pool associated with the vertices of the primitive, or NULL if the primitive has no vertices.
int get_ref_count () const
 Returns the current reference count.
virtual Shading get_shading () const
 Returns the shading properties apparent on this particular primitive.
string get_sort_name () const
 Returns the name of the primitive for the purposes of sorting primitives into different groups, if there is one.
EggTextureget_texture () const
 Returns the first texture on the primitive, if any, or NULL if there are no textures on the primitive.
EggTextureget_texture (int n) const
 Returns the nth texture that has been applied to the primitive.
virtual TypeHandle get_type () const
int get_type_index () const
 Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.
int get_u_degree () const
 Returns the degree of the surface in the U direction.
int get_u_index (int vertex_index) const
 Returns the U index number of the given vertex within the EggPrimitive's linear list of vertices.
double get_u_knot (int k) const
 Returns the nth knot value defined in the U direction.
int get_u_order () const
 Returns the order of the surface in the U direction.
int get_u_subdiv () const
 Returns the requested number of subdivisions in the U direction, or 0 if no particular subdivisions have been requested.
EggUserDataget_user_data () const
 Returns the user data pointer most recently stored on this object, or NULL if nothing was previously stored.
EggUserDataget_user_data (TypeHandle type) const
 Returns the user data pointer of the indicated type, if it exists, or NULL if it does not.
int get_v_degree () const
 Returns the degree of the surface in the V direction.
int get_v_index (int vertex_index) const
 Returns the V index number of the given vertex within the EggPrimitive's linear list of vertices.
double get_v_knot (int k) const
 Returns the nth knot value defined in the V direction.
int get_v_order () const
 Returns the order of the surface in the V direction.
int get_v_subdiv () const
 Returns the requested number of subdivisions in the U direction, or 0 if no particular subdivisions have been requested.
EggVertexget_vertex (int index) const
 Returns a particular index based on its index number.
const LMatrix4dget_vertex_frame () const
 Returns the coordinate frame of the vertices referenced by primitives at or under this node.
const LMatrix4dget_vertex_frame_inv () const
 Returns the inverse of the matrix returned by get_vertex_frame().
const LMatrix4dget_vertex_frame_inv_ptr () const
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_frame_inv() matrix.
const LMatrix4dget_vertex_frame_ptr () const
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_frame() matrix.
int get_vertex_index (int ui, int vi) const
 Returns the index number within the EggPrimitive's list of the control vertex at position ui, vi.
const LMatrix4dget_vertex_to_node () const
 Returns the transformation matrix suitable for converting the vertices as read from the egg file into the coordinate space of the node.
const LMatrix4dget_vertex_to_node_ptr () const
 Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_to_node() matrix.
VisibilityMode get_visibility_mode () const
 Returns the visibility mode that was set, or VM_unspecified if nothing was set.
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object.
bool has_bin () const
 Returns true if a bin name has been set for this particular object.
bool has_color () const
bool has_depth_offset () const
 Returns true if the depth-offset flag has been set for this particular object.
bool has_draw_order () const
 Returns true if the draw-order flag has been set for this particular object.
bool has_material () const
 Returns true if the primitive is materiald (and get_material() will return a real pointer), false otherwise (and get_material() will return NULL).
bool has_name () const
 Returns true if the Namable has a nonempty name set, false if the name is empty.
bool has_normal () const
virtual bool has_normals () const
 Returns true if any of the primitives (e.g.
virtual bool has_primitives () const
 Returns true if there are any primitives (e.g.
bool has_texture () const
 Returns true if the primitive has any textures specified, false otherwise.
bool has_texture (EggTexture *texture) const
 Returns true if the primitive has the particular indicated texture, false otherwise.
bool has_user_data (TypeHandle type) const
 Returns true if the user data pointer of the indicated type has been set, false otherwise.
bool has_user_data () const
 Returns true if a generic user data pointer has recently been set and not yet cleared, false otherwise.
bool has_vertex_color () const
 Returns true if any vertex on the primitive has a specific color set, false otherwise.
bool has_vertex_normal () const
 Returns true if any vertex on the primitive has a specific normal set, false otherwise.
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.
iterator insert (iterator position, EggVertex *x)
virtual bool is_anim_matrix () const
 Returns true if this node represents a table of animation transformation data, false otherwise.
bool is_closed_u () const
 Returns true if the surface appears to be closed in the U direction.
bool is_closed_v () const
 Returns true if the surface appears to be closed in the V direction.
bool is_exact_type (TypeHandle handle) const
 Returns true if the current object is the indicated type exactly.
virtual bool is_joint () const
 Returns true if this particular node represents a <Joint> entry or not.
bool is_local_coord () const
 Returns true if this node's vertices are not in the global coordinate space.
bool is_of_type (TypeHandle handle) const
 Returns true if the current object is or derives from the indicated type.
bool is_under_instance () const
 Returns true if there is an <Instance> node somewhere in the egg tree at or above this node, false otherwise.
bool is_under_transform () const
 Returns true if there is a <Transform> entry somewhere in the egg tree at or above this node, false otherwise.
bool is_valid () const
 Returns true if the NURBS parameters are all internally consistent (e.g.
virtual bool joint_has_primitives () const
 Returns true if there are any primitives (e.g.
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.
 MAKE_SEQ (get_u_knots, get_num_u_knots, get_u_knot)
 MAKE_SEQ (get_textures, get_num_textures, get_texture)
 MAKE_SEQ (get_vertices, get_num_vertices, get_vertex)
 MAKE_SEQ (get_v_knots, get_num_v_knots, get_v_knot)
bool matches_color (const EggAttributes &other) const
 Returns true if this color matches that of the other EggAttributes object, include the morph list.
bool matches_normal (const EggAttributes &other) const
 Returns true if this normal matches that of the other EggAttributes object, include the morph list.
void operator delete (void *ptr)
void operator delete (void *ptr, void *)
void operator delete (void *ptr, void *)
void operator delete (void *ptr)
void operator delete[] (void *, void *)
void operator delete[] (void *ptr)
void operator delete[] (void *, void *)
void operator delete[] (void *ptr)
void * operator new (size_t size)
void * operator new (size_t size, void *ptr)
void * operator new (size_t size, void *ptr)
void * operator new (size_t size)
void * operator new[] (size_t size, void *ptr)
void * operator new[] (size_t size)
void * operator new[] (size_t size, void *ptr)
void * operator new[] (size_t size)
bool operator!= (const EggRenderMode &other) const
bool operator< (const EggRenderMode &other) const
EggNurbsSurfaceoperator= (const EggNurbsSurface &copy)
bool operator== (const EggRenderMode &other) const
EggVertexoperator[] (int index) const
 This is read-only: you can't assign directly to an indexed vertex.
void output (ostream &out) const
 Outputs the Namable.
bool parse_egg (const string &egg_syntax)
 Parses the egg syntax given in the indicate string as if it had been read from the egg file within this object's definition.
virtual void post_apply_flat_attribute ()
 Intended as a followup to apply_last_attribute(), this also sets an attribute on the first vertices of the primitive, if they don't already have an attribute set, just so they end up with *something*.
reverse_iterator rbegin () const
void ref () const
 Explicitly increments the reference count.
void remove_doubled_verts (bool closed)
 Certain kinds of primitives, particularly polygons, don't like to have the same vertex repeated consecutively.
void remove_nonunique_verts ()
 Removes any multiple appearances of the same vertex from the primitive.
EggVertexremove_vertex (EggVertex *vertex)
 Removes the indicated vertex from the primitive and returns it.
int rename_node (vector_string strip_prefix)
 Rename by stripping out the prefix.
reverse_iterator rend () const
void replace (iterator position, EggVertex *vertex)
 Replaces the vertex at the indicated position with the indicated vertex.
virtual void reverse_vertex_ordering ()
 Reverses the ordering of the vertices in this primitive, if appropriate, in order to change the direction the polygon appears to be facing.
void set_alpha_mode (AlphaMode mode)
 Specifies precisely how the transparency for this geometry should be achieved, or if it should be used.
void set_bface_flag (bool flag)
 Sets the backfacing flag of the polygon.
void set_bin (const string &bin)
 Sets the "bin" string for this particular object.
void set_color (const Colorf &Color)
void set_cv (int ui, int vi, EggVertex *vertex)
 Redefines the control vertex associated with a particular u, v coordinate pair.
void set_depth_offset (int bias)
 Sets the "depth-offset" flag associated with this object.
void set_depth_test_mode (DepthTestMode mode)
 Specifies whether this geometry should be tested against the depth buffer when it is drawn (assuming the rendering backend provides a depth buffer).
void set_depth_write_mode (DepthWriteMode mode)
 Specifies whether writes should be made to the depth buffer (assuming the rendering backend provides a depth buffer) when rendering this geometry.
void set_draw_order (int order)
 Sets the "draw-order" flag associated with this object.
void set_material (EggMaterial *material)
 Applies the indicated material to the primitive.
void set_name (const string &name)
void set_normal (const Normald &normal)
void set_num_u_knots (int num)
 Directly changes the number of knots in the U direction.
void set_num_v_knots (int num)
 Directly changes the number of knots in the V direction.
void set_texture (EggTexture *texture)
 Replaces the current list of textures with the indicated texture.
void set_u_knot (int k, double value)
 Resets the value of the indicated knot as indicated.
void set_u_order (int u_order)
 Directly changes the order in the U direction to the indicated value (which must be an integer in the range 1 <= u_order <= 4).
void set_u_subdiv (int subdiv)
 Sets the number of subdivisions in the U direction that will be requested across the surface.
void set_user_data (EggUserData *user_data)
 Sets the user data associated with this object.
void set_v_knot (int k, double value)
 Resets the value of the indicated knot as indicated.
void set_v_order (int v_order)
 Directly changes the order in the V direction to the indicated value (which must be an integer in the range 1 <= v_order <= 4).
void set_v_subdiv (int subdiv)
 Sets the number of subdivisions in the U direction that will be requested across the surface.
void set_vertex (int index, EggVertex *vertex)
 Replaces a particular vertex based on its index number in the list of vertices.
void set_visibility_mode (VisibilityMode mode)
 Specifies whether this geometry is to be considered normally visible, or hidden.
void setup (int u_order, int v_order, int num_u_knots, int num_v_knots)
 Prepares a new surface definition with the indicated order and number of knots in each dimension.
size_type size () const
bool sorts_less_than (const EggAttributes &other) const
 An ordering operator to compare two vertices for sorting order.
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus.
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus.
void test_under_integrity () const
 Recursively checks the integrity of the _under_flags, _parent, and _depth members of this node and all of its ancestors.
void test_vref_integrity () const
 Verifies that each vertex in the primitive exists and that it knows it is referenced by the primitive.
void transform (const LMatrix4d &mat)
 Applies the indicated transformation to the node and all of its descendants.
void transform (const LMatrix4d &mat)
 Applies the indicated transformation matrix to the attributes.
void transform_vertices_only (const LMatrix4d &mat)
 Applies the indicated transformation only to vertices that appear in global space within vertex pools at this node and below.
virtual void unify_attributes (Shading shading)
 If the shading property is S_per_vertex, ensures that all vertices have a normal and a color, and the overall primitive does not.
virtual bool unref () const
 Explicitly decrements the reference count.
void weak_ref (WeakPointerToVoid *ptv)
 Adds the indicated PointerToVoid as a weak reference to this object.
void weak_unref (WeakPointerToVoid *ptv)
 Removes the indicated PointerToVoid as a weak reference to this object.
virtual void write (ostream &out, int indent_level) const
 Writes the nurbsSurface to the indicated output stream in Egg format.
void write_header (ostream &out, int indent_level, const char *egg_keyword) const
 Writes the first line of the egg object, e.g.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()
static AlphaMode string_alpha_mode (const string &string)
 Returns the AlphaMode value associated with the given string representation, or AM_unspecified if the string does not match any known AlphaMode value.
static DepthTestMode string_depth_test_mode (const string &string)
 Returns the DepthTestMode value associated with the given string representation, or DTM_unspecified if the string does not match any known DepthTestMode value.
static DepthWriteMode string_depth_write_mode (const string &string)
 Returns the DepthWriteMode value associated with the given string representation, or DWM_unspecified if the string does not match any known DepthWriteMode value.
static VisibilityMode string_visibility_mode (const string &string)
 Returns the HiddenMode value associated with the given string representation, or VM_unspecified if the string does not match any known HiddenMode value.

Public Attributes

Curves _curves_on_surface
EggMorphNormalList _dnormals
EggMorphColorList _drgbas
Trims _trims

Protected Types

typedef RefCountObj< LMatrix4dMatrixFrame
enum  UnderFlags { UF_under_instance = 0x001, UF_under_transform = 0x002, UF_local_coord = 0x004 }

Protected Member Functions

virtual void adjust_under ()
 This is called within update_under() after all the various under settings have been inherited directly from the parent node.
void do_apply_flat_attribute (int vertex_index, EggAttributes *attrib)
 This is used to implement apply_first_attribute() and apply_last_attribute().
bool do_test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus.
bool do_test_ref_count_nonzero () const
 Returns true if the reference count is nonzero, false otherwise.
virtual bool egg_start_parse_body ()
 This function is called within parse_egg().
virtual void prepare_add_vertex (EggVertex *vertex, int i, int n)
 Marks the vertex as belonging to the primitive.
virtual void prepare_remove_vertex (EggVertex *vertex, int i, int n)
 Marks the vertex as removed from the primitive.
 PT (MatrixFrame) _vertex_to_node
 PT (MatrixFrame) _node_frame_inv
 PT (MatrixFrame) _node_to_vertex
 PT (MatrixFrame) _vertex_frame_inv
 PT (MatrixFrame) _vertex_frame
 PT (MatrixFrame) _node_frame
virtual void r_apply_texmats (EggTextureCollection &textures)
 The recursive implementation of apply_texmats().
virtual void r_flatten_transforms ()
 The recursive implementation of flatten_transforms().
virtual void r_mark_coordsys (CoordinateSystem cs)
 This is only called immediately after loading an egg file from disk, to propagate the value found in the CoordinateSystem entry (or the default Y-up coordinate system) to all nodes that care about what the coordinate system is.
virtual void r_transform (const LMatrix4d &mat, const LMatrix4d &inv, CoordinateSystem to_cs)
 This is called from within the egg code by transform().
virtual void r_transform_vertices (const LMatrix4d &mat)
 This is called from within the egg code by transform_vertices_only()().
virtual void update_under (int depth_offset)
 This function is called from within EggGroupNode whenever the parentage of the node has changed.
void write_body (ostream &out, int indent_level) const
 Writes the attributes and the vertices referenced by the primitive to the indicated output stream in Egg format.

Protected Attributes

int _depth
EggGroupNode_parent
int _under_flags
Vertices _vertices

Detailed Description

A parametric NURBS surface.

Definition at line 29 of file eggNurbsSurface.h.


Member Function Documentation

void EggPrimitive::add_texture ( EggTexture texture) [inline, inherited]

Applies the indicated texture to the primitive.

Note that, in the case of multiple textures being applied to a single primitive, the order in which the textures are applied does not affect the rendering order; use EggTexture::set_sort() to specify that.

Definition at line 197 of file eggPrimitive.I.

Referenced by DaeMaterials::apply_to(), and EggPrimitive::set_texture().

EggVertex * EggPrimitive::add_vertex ( EggVertex vertex) [inherited]
void EggNode::adjust_under ( ) [protected, virtual, inherited]

This is called within update_under() after all the various under settings have been inherited directly from the parent node.

It is responsible for adjusting these settings to reflect states local to the current node; for instance, an <Instance> node will force the UF_under_instance bit on.

Reimplemented in EggGroup.

Definition at line 401 of file eggNode.cxx.

Referenced by EggNode::update_under().

void EggPrimitive::apply_first_attribute ( ) [virtual, inherited]

Sets the first vertex of the triangle (or each component) to the primitive normal and/or color, if the primitive is flat-shaded.

This reflects the DirectX convention of storing flat-shaded properties on the first vertex, although it is not usually a convention in Egg.

This may introduce redundant vertices to the vertex pool.

Reimplemented in EggCompositePrimitive, and EggTriangleFan.

Definition at line 506 of file eggPrimitive.cxx.

References EggPrimitive::do_apply_flat_attribute().

Referenced by EggGroupNode::apply_first_attribute().

void EggPrimitive::apply_last_attribute ( ) [virtual, inherited]

Sets the last vertex of the triangle (or each component) to the primitive normal and/or color, if the primitive is flat-shaded.

This reflects the OpenGL convention of storing flat-shaded properties on the last vertex, although it is not usually a convention in Egg.

This may introduce redundant vertices to the vertex pool.

Reimplemented in EggCompositePrimitive.

Definition at line 486 of file eggPrimitive.cxx.

References EggPrimitive::do_apply_flat_attribute().

Referenced by EggGroupNode::apply_last_attribute().

void EggNode::apply_texmats ( ) [inherited]

Applies the texture matrices to the UV's of the vertices that reference them, and then removes the texture matrices from the textures themselves.

Definition at line 58 of file eggNode.cxx.

References EggTextureCollection::find_used_textures(), and EggNode::r_apply_texmats().

EggTransform * EggObject::as_transform ( ) [virtual, inherited]

Returns this object cross-cast to an EggTransform pointer, if it inherits from EggTransform, or NULL if it does not.

Reimplemented in EggGroup, and EggTexture.

Definition at line 183 of file eggObject.cxx.

TypedObject * TypedObject::as_typed_object ( ) [inline, inherited]

Returns the object, upcast (if necessary) to a TypedObject pointer.

Definition at line 99 of file typedObject.I.

const TypedObject * TypedObject::as_typed_object ( ) const [inline, inherited]

Returns the object, upcast (if necessary) to a TypedObject pointer.

Definition at line 110 of file typedObject.I.

bool EggPrimitive::cleanup ( ) [virtual, inherited]

Cleans up modeling errors in whatever context this makes sense.

For instance, for a polygon, this calls remove_doubled_verts(true). For a point, it calls remove_nonunique_verts(). Returns true if the primitive is valid, or false if it is degenerate.

Reimplemented in EggCompositePrimitive, EggPoint, and EggPolygon.

Definition at line 566 of file eggPrimitive.cxx.

Referenced by EggGroupNode::remove_invalid_primitives().

void EggPrimitive::clear ( ) [inline, inherited]

Removes all of the vertices from the primitive.

Definition at line 432 of file eggPrimitive.I.

Referenced by EggPrimitive::copy_vertices(), and EggGroupNode::rebuild_vertex_pools().

void EggRenderMode::clear_bin ( ) [inline, inherited]

Removes the bin name that was set for this particular object.

See set_bin().

Definition at line 277 of file eggRenderMode.I.

void EggPrimitive::clear_connected_shading ( ) [inline, inherited]

Resets the connected_shading member in this primitive, so that get_connected_shading() will recompute a new value.

Definition at line 98 of file eggPrimitive.I.

Referenced by EggGroupNode::clear_connected_shading().

void EggRenderMode::clear_depth_offset ( ) [inline, inherited]

Removes the depth-offset flag from this particular object.

See set_depth_offset().

Definition at line 178 of file eggRenderMode.I.

void EggRenderMode::clear_draw_order ( ) [inline, inherited]

Removes the draw-order flag from this particular object.

See set_draw_order().

Definition at line 227 of file eggRenderMode.I.

void EggPrimitive::clear_material ( ) [inline, inherited]

Removes any material from the primitive.

Definition at line 251 of file eggPrimitive.I.

void Namable::clear_name ( ) [inline, inherited]

Resets the Namable's name to empty.

Reimplemented in AsyncTask.

Definition at line 64 of file namable.I.

void EggPrimitive::clear_texture ( ) [inline, inherited]

Removes any texturing from the primitive.

Definition at line 207 of file eggPrimitive.I.

Referenced by EggPrimitive::set_texture().

void EggObject::clear_user_data ( ) [inherited]

Removes *all* user data pointers from the node.

Definition at line 153 of file eggObject.cxx.

void EggObject::clear_user_data ( TypeHandle  type) [inherited]

Removes the user data pointer of the indicated type.

Definition at line 164 of file eggObject.cxx.

int EggAttributes::compare_to ( const EggAttributes other) const [inherited]

An ordering operator to compare two vertices for sorting order.

This imposes an arbitrary ordering useful to identify unique vertices.

Definition at line 111 of file eggAttributes.cxx.

References LVecBase4f::compare_to(), EggMorphList< MorphType >::compare_to(), and LVecBase3d::compare_to().

Referenced by EggAttributes::sorts_less_than(), and EggCompositePrimitive::write_body().

void EggPrimitive::copy_attributes ( const EggPrimitive other) [inherited]

Copies the rendering attributes from the indicated primitive.

Definition at line 307 of file eggPrimitive.cxx.

References EggPrimitive::get_bface_flag(), EggPrimitive::get_material(), EggPrimitive::set_bface_flag(), and EggPrimitive::set_material().

void EggPrimitive::copy_attributes ( const EggAttributes other) [inherited]

Copies the rendering attributes from the indicated primitive.

Definition at line 296 of file eggPrimitive.cxx.

Referenced by EggTriangleFan::do_triangulate(), EggTriangleStrip::do_triangulate(), and EggMesherFanMaker::unroll().

void EggAttributes::copy_color ( const EggAttributes other) [inline, inherited]

Sets this color to be the same as the other's, include morphs.

If the other has no color, this clears the color.

Definition at line 165 of file eggAttributes.I.

References EggAttributes::get_color().

Referenced by EggPrimitive::unify_attributes(), and EggCompositePrimitive::unify_attributes().

void EggAttributes::copy_normal ( const EggAttributes other) [inline, inherited]

Sets this normal to be the same as the other's, include morphs.

If the other has no normal, this clears the normal.

Definition at line 84 of file eggAttributes.I.

Referenced by EggPrimitive::unify_attributes(), and EggCompositePrimitive::unify_attributes().

void EggPrimitive::copy_vertices ( const EggPrimitive other) [inherited]

Replaces the current primitive's list of vertices with a copy of the list of vertices on the other primitive.

Definition at line 793 of file eggPrimitive.cxx.

References EggPrimitive::add_vertex(), EggPrimitive::clear(), and EggPrimitive::test_vref_integrity().

EggRenderMode * EggPrimitive::determine_alpha_mode ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this primitive that has an alpha_mode other than AM_unspecified.

Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Reimplemented from EggNode.

Definition at line 38 of file eggPrimitive.cxx.

References EggTexture::affects_polygon_alpha(), EggRenderMode::get_alpha_mode(), EggPrimitive::get_num_textures(), and EggPrimitive::get_texture().

Referenced by EggRenderState::fill_state().

EggRenderMode * EggPrimitive::determine_bin ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this primitive that has a bin specified.

Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Reimplemented from EggNode.

Definition at line 209 of file eggPrimitive.cxx.

References EggPrimitive::get_num_textures(), EggPrimitive::get_texture(), and EggRenderMode::has_bin().

Referenced by EggRenderState::fill_state().

bool EggNode::determine_decal ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "decal" flag set.

Returns the value of the decal flag if it is found, or false if it is not.

In other words, returns true if the "decal" flag is in effect for the indicated node, false otherwise.

Reimplemented in EggGroup.

Definition at line 247 of file eggNode.cxx.

References EggNode::determine_decal().

Referenced by EggNode::determine_decal().

EggRenderMode * EggPrimitive::determine_depth_offset ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this primitive that has a depth_offset specified.

Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Reimplemented from EggNode.

Definition at line 155 of file eggPrimitive.cxx.

References EggPrimitive::get_num_textures(), EggPrimitive::get_texture(), and EggRenderMode::has_depth_offset().

Referenced by EggRenderState::fill_state().

EggRenderMode * EggPrimitive::determine_depth_test_mode ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a depth_test_mode other than DTM_unspecified.

Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Reimplemented from EggNode.

Definition at line 101 of file eggPrimitive.cxx.

References EggRenderMode::get_depth_test_mode(), EggPrimitive::get_num_textures(), and EggPrimitive::get_texture().

Referenced by EggRenderState::fill_state().

EggRenderMode * EggPrimitive::determine_depth_write_mode ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a depth_write_mode other than DWM_unspecified.

Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Reimplemented from EggNode.

Definition at line 74 of file eggPrimitive.cxx.

References EggRenderMode::get_depth_write_mode(), EggPrimitive::get_num_textures(), and EggPrimitive::get_texture().

Referenced by EggRenderState::fill_state().

EggRenderMode * EggPrimitive::determine_draw_order ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this primitive that has a draw_order specified.

Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Reimplemented from EggNode.

Definition at line 182 of file eggPrimitive.cxx.

References EggPrimitive::get_num_textures(), EggPrimitive::get_texture(), and EggRenderMode::has_draw_order().

Referenced by EggRenderState::fill_state().

bool EggNode::determine_indexed ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup at this level or above that has the "indexed" scalar set.

Returns the value of the indexed scalar if it is found, or false if it is not.

In other words, returns true if the "indexed" flag is in effect for the indicated node, false otherwise.

Reimplemented in EggGroup.

Definition at line 227 of file eggNode.cxx.

References EggNode::determine_indexed().

Referenced by EggNode::determine_indexed().

EggRenderMode * EggPrimitive::determine_visibility_mode ( ) [virtual, inherited]

Walks back up the hierarchy, looking for an EggGroup or EggPrimitive or some such object at this level or above this node that has a visibility_mode other than VM_unspecified.

Returns a valid EggRenderMode pointer if one is found, or NULL otherwise.

Reimplemented from EggNode.

Definition at line 128 of file eggPrimitive.cxx.

References EggPrimitive::get_num_textures(), EggPrimitive::get_texture(), and EggRenderMode::get_visibility_mode().

Referenced by EggRenderState::fill_state().

void EggPrimitive::do_apply_flat_attribute ( int  vertex_index,
EggAttributes attrib 
) [protected, inherited]
bool ReferenceCount::do_test_ref_count_integrity ( ) const [protected, inherited]

Does some easy checks to make sure that the reference count isn't completely bogus.

Returns true if ok, false otherwise.

Reimplemented in NodeReferenceCount, CachedTypedWritableReferenceCount, and NodeCachedReferenceCount.

Definition at line 29 of file referenceCount.cxx.

Referenced by ReferenceCount::do_test_ref_count_nonzero(), and ReferenceCount::test_ref_count_integrity().

bool ReferenceCount::do_test_ref_count_nonzero ( ) const [protected, inherited]

Returns true if the reference count is nonzero, false otherwise.

Definition at line 56 of file referenceCount.cxx.

References ReferenceCount::do_test_ref_count_integrity().

Referenced by ReferenceCount::test_ref_count_nonzero().

bool EggPrimitive::egg_start_parse_body ( ) [protected, virtual, inherited]

This function is called within parse_egg().

It should call the appropriate function on the lexer to initialize the parser into the state associated with this object. If the object cannot be parsed into directly, it should return false.

Reimplemented from EggNode.

Definition at line 1016 of file eggPrimitive.cxx.

EggPrimitive::iterator EggPrimitive::erase ( iterator  first,
iterator  last 
) [inherited]

Part of the implementaion of the EggPrimitive as an STL container.

Most of the rest of these functions are inline and declared in EggPrimitive.I.

Definition at line 714 of file eggPrimitive.cxx.

References EggPrimitive::prepare_remove_vertex(), and EggPrimitive::test_vref_integrity().

EggPrimitive::iterator EggPrimitive::find ( EggVertex vertex) [inherited]

Returns the iterator pointing to the indicated vertex, or end() if the vertex is not part of the primitive.

Definition at line 736 of file eggPrimitive.cxx.

Referenced by EggPrimitive::has_texture(), EggVertexPool::remove_unused_vertices(), and EggPrimitive::remove_vertex().

void EggNode::flatten_transforms ( ) [inline, inherited]

Removes any transform and instance records from this node in the scene graph and below.

If an instance node is encountered, removes the instance and applies the transform to its vertices, duplicating vertices if necessary.

Since this function may result in duplicated vertices, it may be a good idea to call remove_unused_vertices() after calling this.

Definition at line 351 of file eggNode.I.

References EggNode::r_flatten_transforms(), and EggNode::update_under().

EggRenderMode::AlphaMode EggRenderMode::get_alpha_mode ( ) const [inline, inherited]

Returns the alpha mode that was set, or AM_unspecified if nothing was set.

See set_alpha_mode().

Definition at line 130 of file eggRenderMode.I.

Referenced by EggPrimitive::determine_alpha_mode(), EggGroup::determine_alpha_mode(), EggRenderState::fill_state(), TextureReference::from_egg(), and EggRenderMode::write().

bool EggPrimitive::get_bface_flag ( ) const [inline, inherited]

Retrieves the backfacing flag of the polygon.

See set_bface_flag().

Definition at line 301 of file eggPrimitive.I.

Referenced by EggPrimitive::copy_attributes(), EggRenderState::fill_state(), EggPolysetMaker::sorts_less(), and EggPrimitive::write_body().

string EggRenderMode::get_bin ( ) const [inline, inherited]

Returns the bin name that has been set for this particular object, if any.

See set_bin().

Definition at line 255 of file eggRenderMode.I.

Referenced by EggRenderState::fill_state(), and EggRenderMode::write().

Colorf EggAttributes::get_color ( ) const [inline, inherited]
EggPrimitive::Shading EggPrimitive::get_connected_shading ( ) const [inline, inherited]

Determines what sort of shading properties this primitive's connected neighbors have.

To get the most accurate results, you should first call clear_connected_shading() on all connected primitives (or on all primitives in the egg file). It might also be a good idea to call remove_unused_vertices() to ensure proper connectivity.

You may find it easiest to call these other methods on the EggData root node (they are defined on EggGroupNode).

Definition at line 120 of file eggPrimitive.I.

Referenced by EggRenderState::fill_state(), EggGroupNode::get_connected_shading(), and EggGroupNode::unify_attributes().

EggVertex * EggNurbsSurface::get_cv ( int  ui,
int  vi 
) const [inline]

Returns the control vertex at the indicate U, V position.

Definition at line 322 of file eggNurbsSurface.I.

References EggPrimitive::get_vertex(), and get_vertex_index().

int EggNode::get_depth ( ) const [inline, inherited]

Returns the number of nodes above this node in the egg hierarchy.

Definition at line 71 of file eggNode.I.

int EggRenderMode::get_depth_offset ( ) const [inline, inherited]

Returns the "depth-offset" flag as set for this particular object.

See set_depth_offset().

Definition at line 156 of file eggRenderMode.I.

Referenced by EggRenderState::fill_state(), and EggRenderMode::write().

EggRenderMode::DepthTestMode EggRenderMode::get_depth_test_mode ( ) const [inline, inherited]

Returns the depth_test mode that was set, or DTM_unspecified if nothing was set.

See set_depth_test_mode().

Definition at line 73 of file eggRenderMode.I.

Referenced by EggGroup::determine_depth_test_mode(), EggPrimitive::determine_depth_test_mode(), EggRenderState::fill_state(), and EggRenderMode::write().

EggRenderMode::DepthWriteMode EggRenderMode::get_depth_write_mode ( ) const [inline, inherited]

Returns the depth_write mode that was set, or DWM_unspecified if nothing was set.

See set_depth_write_mode().

Definition at line 47 of file eggRenderMode.I.

Referenced by EggGroup::determine_depth_write_mode(), EggPrimitive::determine_depth_write_mode(), EggRenderState::fill_state(), and EggRenderMode::write().

int EggRenderMode::get_draw_order ( ) const [inline, inherited]

Returns the "draw-order" flag as set for this particular object.

See set_draw_order().

Definition at line 205 of file eggRenderMode.I.

Referenced by EggRenderState::fill_state(), and EggRenderMode::write().

EggMaterial * EggPrimitive::get_material ( ) const [inline, inherited]
const LMatrix4d & EggNode::get_node_frame ( ) const [inline, inherited]

Returns the coordinate frame of the node itself.

This is simply the net product of all transformations up to the root.

Definition at line 152 of file eggNode.I.

References LMatrix4d::ident_mat().

Referenced by EggGroup::adjust_under().

const LMatrix4d & EggNode::get_node_frame_inv ( ) const [inline, inherited]

Returns the inverse of the matrix returned by get_node_frame().

See get_node_frame().

Definition at line 183 of file eggNode.I.

References LMatrix4d::ident_mat().

Referenced by EggGroup::adjust_under().

const LMatrix4d * EggNode::get_node_frame_inv_ptr ( ) const [inline, inherited]

Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_frame_inv() matrix.

Definition at line 277 of file eggNode.I.

const LMatrix4d * EggNode::get_node_frame_ptr ( ) const [inline, inherited]

Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_frame() matrix.

Definition at line 252 of file eggNode.I.

const LMatrix4d & EggNode::get_node_to_vertex ( ) const [inline, inherited]

Returns the transformation matrix suitable for converting vertices in the coordinate space of the node to the appropriate coordinate space for storing in the egg file.

This is the same thing as:

get_node_frame() * get_vertex_frame_inv()

Definition at line 223 of file eggNode.I.

References LMatrix4d::ident_mat().

Referenced by XFileMesh::create_polygons().

const LMatrix4d * EggNode::get_node_to_vertex_ptr ( ) const [inline, inherited]

Returns either a NULL pointer or a unique pointer shared by nodes with the same get_node_to_vertex() matrix.

Definition at line 301 of file eggNode.I.

int EggNurbsSurface::get_num_cvs ( ) const [inline]

Returns the total number of control vertices that should* be defined for the surface.

This is determined by the number of knots and the order, in each direction; it does not necessarily reflect the number of vertices that have actually been added to the surface. (However, if the number of vertices in the surface are wrong, the surface is invalid.)

Definition at line 244 of file eggNurbsSurface.I.

References get_num_u_cvs(), and get_num_v_cvs().

Referenced by get_u_index(), get_v_index(), and is_valid().

int EggPrimitive::get_num_textures ( ) const [inline, inherited]
int EggNurbsSurface::get_num_u_cvs ( ) const [inline]

Returns the number of control vertices that should be present in the U direction.

This is determined by the number of knots and the order; it does not necessarily reflect the number of vertices that have actually been added to the surface. (However, if the number of vertices in the surface are wrong, the surface is invalid.)

Definition at line 212 of file eggNurbsSurface.I.

References get_num_u_knots(), and get_u_order().

Referenced by get_num_cvs(), get_u_index(), get_v_index(), and get_vertex_index().

int EggNurbsSurface::get_num_u_knots ( ) const [inline]

Returns the number of knots in the U direction.

Definition at line 186 of file eggNurbsSurface.I.

Referenced by get_num_u_cvs(), and is_valid().

int EggNurbsSurface::get_num_v_cvs ( ) const [inline]

Returns the number of control vertices that should be present in the V direction.

This is determined by the number of knots and the order; it does not necessarily reflect the number of vertices that have actually been added to the surface. (However, if the number of vertices in the surface are wrong, the surface is invalid.)

Definition at line 228 of file eggNurbsSurface.I.

References get_num_v_knots(), and get_v_order().

Referenced by get_num_cvs(), and get_vertex_index().

int EggNurbsSurface::get_num_v_knots ( ) const [inline]

Returns the number of knots in the V direction.

Definition at line 196 of file eggNurbsSurface.I.

Referenced by get_num_v_cvs(), and is_valid().

EggVertexPool * EggPrimitive::get_pool ( ) const [inline, inherited]

Returns the vertex pool associated with the vertices of the primitive, or NULL if the primitive has no vertices.

Definition at line 480 of file eggPrimitive.I.

Referenced by EggPrimitive::do_apply_flat_attribute(), EggLoader::make_polyset(), EggMesher::mesh(), EggPrimitive::prepare_add_vertex(), and EggPrimitive::write_body().

int ReferenceCount::get_ref_count ( ) const [inline, inherited]
EggPrimitive::Shading EggPrimitive::get_shading ( ) const [virtual, inherited]

Returns the shading properties apparent on this particular primitive.

This returns S_per_vertex if the vertices have colors or normals (and they are not all the same values), or for a simple primitive, S_overall otherwise. A composite primitive may also return S_per_face if the individual component primitives have colors or normals that are not all the same values.

To get the most accurate results, you should call clear_shading() on all connected primitives (or on all primitives in the egg file), followed by get_shading() on each primitive. You may find it easiest to call these methods on the EggData root node (they are defined on EggGroupNode).

Reimplemented in EggCompositePrimitive.

Definition at line 247 of file eggPrimitive.cxx.

References EggPrimitive::get_vertex(), EggPrimitive::has_vertex_color(), EggPrimitive::has_vertex_normal(), EggAttributes::matches_color(), and EggAttributes::matches_normal().

Referenced by EggPrimitive::unify_attributes(), and EggGroupNode::unify_attributes().

string EggPrimitive::get_sort_name ( ) const [inline, inherited]

Returns the name of the primitive for the purposes of sorting primitives into different groups, if there is one.

Presently, this is defined as the primitive name itself, unless it begins with a digit.

Definition at line 82 of file eggPrimitive.I.

Referenced by EggBinner::sorts_less().

EggTexture * EggPrimitive::get_texture ( ) const [inline, inherited]

Returns the first texture on the primitive, if any, or NULL if there are no textures on the primitive.

This method is deprecated and is used in support of single-texturing only. New code should be written to use the multitexture variants instead.

Definition at line 182 of file eggPrimitive.I.

References EggPrimitive::has_texture().

Referenced by EggPrimitive::determine_alpha_mode(), EggPrimitive::determine_bin(), EggPrimitive::determine_depth_offset(), EggPrimitive::determine_depth_test_mode(), EggPrimitive::determine_depth_write_mode(), EggPrimitive::determine_draw_order(), EggPrimitive::determine_visibility_mode(), EggRenderState::fill_state(), EggTextureCollection::find_used_textures(), XFileVertex::set_from_egg(), XFileMaterial::set_from_egg(), EggPolysetMaker::sorts_less(), and EggPrimitive::write_body().

EggTexture * EggPrimitive::get_texture ( int  n) const [inline, inherited]

Returns the nth texture that has been applied to the primitive.

Definition at line 229 of file eggPrimitive.I.

int TypedObject::get_type_index ( ) const [inline, inherited]

Returns the internal index number associated with this object's TypeHandle, a unique number for each different type.

This is equivalent to get_type().get_index().

Definition at line 52 of file typedObject.I.

References TypeHandle::get_index().

int EggNurbsSurface::get_u_degree ( ) const [inline]

Returns the degree of the surface in the U direction.

For a typical NURBS, the degree is 3.

Definition at line 165 of file eggNurbsSurface.I.

int EggNurbsSurface::get_u_index ( int  vertex_index) const [inline]

Returns the U index number of the given vertex within the EggPrimitive's linear list of vertices.

An EggNurbsSurface maps a linear list of vertices to its 2-d mesh; this returns the U index number that corresponds to the nth vertex in the list.

Definition at line 258 of file eggNurbsSurface.I.

References get_num_cvs(), and get_num_u_cvs().

double EggNurbsSurface::get_u_knot ( int  k) const [inline]

Returns the nth knot value defined in the U direction.

Definition at line 298 of file eggNurbsSurface.I.

Referenced by is_closed_u(), and is_valid().

int EggNurbsSurface::get_u_order ( ) const [inline]

Returns the order of the surface in the U direction.

The order is the degree of the NURBS equation plus 1; for a typical NURBS, the order is 4. With this implementation of NURBS, the order must be in the range [1, 4].

Definition at line 140 of file eggNurbsSurface.I.

Referenced by get_num_u_cvs(), is_closed_u(), and write().

int EggSurface::get_u_subdiv ( ) const [inline, inherited]

Returns the requested number of subdivisions in the U direction, or 0 if no particular subdivisions have been requested.

Definition at line 77 of file eggSurface.I.

Referenced by write().

EggUserData * EggObject::get_user_data ( ) const [inherited]

Returns the user data pointer most recently stored on this object, or NULL if nothing was previously stored.

Definition at line 102 of file eggObject.cxx.

Referenced by MayaNodeTree::get_egg_group(), and EggBinner::sorts_less().

EggUserData * EggObject::get_user_data ( TypeHandle  type) const [inherited]

Returns the user data pointer of the indicated type, if it exists, or NULL if it does not.

Definition at line 113 of file eggObject.cxx.

int EggNurbsSurface::get_v_degree ( ) const [inline]

Returns the degree of the surface in the V direction.

for a typical NURBS, the degree is 3.

Definition at line 176 of file eggNurbsSurface.I.

int EggNurbsSurface::get_v_index ( int  vertex_index) const [inline]

Returns the V index number of the given vertex within the EggPrimitive's linear list of vertices.

An EggNurbsSurface maps a linear list of vertices to its 2-d mesh; this returns the V index number that corresponds to the nth vertex in the list.

Definition at line 273 of file eggNurbsSurface.I.

References get_num_cvs(), and get_num_u_cvs().

double EggNurbsSurface::get_v_knot ( int  k) const [inline]

Returns the nth knot value defined in the V direction.

Definition at line 310 of file eggNurbsSurface.I.

Referenced by is_closed_v(), and is_valid().

int EggNurbsSurface::get_v_order ( ) const [inline]

Returns the order of the surface in the V direction.

The order is the degree of the NURBS equation plus 1; for a typical NURBS, the order is 4. With this implementation of NURBS, the order must be in the range [1, 4].

Definition at line 154 of file eggNurbsSurface.I.

Referenced by get_num_v_cvs(), is_closed_v(), and write().

int EggSurface::get_v_subdiv ( ) const [inline, inherited]

Returns the requested number of subdivisions in the U direction, or 0 if no particular subdivisions have been requested.

Definition at line 104 of file eggSurface.I.

Referenced by write().

EggVertex * EggPrimitive::get_vertex ( int  index) const [inline, inherited]
const LMatrix4d & EggNode::get_vertex_frame ( ) const [inline, inherited]

Returns the coordinate frame of the vertices referenced by primitives at or under this node.

This is not the same as get_node_frame().

Generally, vertices in an egg file are stored in the global coordinate space, regardless of the transforms defined at each node. Thus, get_vertex_frame() will usually return the identity transform (global coordinate space). However, primitives under an <Instance> entry reference their vertices in the coordinate system under effect at the time of the <Instance>. Thus, nodes under an <Instance> entry may return this non-identity matrix.

Specifically, this may return a non-identity matrix only if is_local_coord() is true.

Definition at line 135 of file eggNode.I.

References LMatrix4d::ident_mat().

Referenced by EggGroup::adjust_under(), EggPrimitive::r_flatten_transforms(), EggGroup::r_flatten_transforms(), XFileVertex::set_from_egg(), XFileNormal::set_from_egg(), EggToDXFLayer::write_3d_face(), and EggToDXFLayer::write_polyline().

const LMatrix4d & EggNode::get_vertex_frame_inv ( ) const [inline, inherited]

Returns the inverse of the matrix returned by get_vertex_frame().

See get_vertex_frame().

Definition at line 167 of file eggNode.I.

References LMatrix4d::ident_mat().

Referenced by EggGroup::adjust_under().

const LMatrix4d * EggNode::get_vertex_frame_inv_ptr ( ) const [inline, inherited]

Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_frame_inv() matrix.

Definition at line 264 of file eggNode.I.

const LMatrix4d * EggNode::get_vertex_frame_ptr ( ) const [inline, inherited]

Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_frame() matrix.

Definition at line 239 of file eggNode.I.

int EggNurbsSurface::get_vertex_index ( int  ui,
int  vi 
) const [inline]

Returns the index number within the EggPrimitive's list of the control vertex at position ui, vi.

Definition at line 285 of file eggNurbsSurface.I.

References get_num_u_cvs(), and get_num_v_cvs().

Referenced by get_cv(), and set_cv().

const LMatrix4d & EggNode::get_vertex_to_node ( ) const [inline, inherited]

Returns the transformation matrix suitable for converting the vertices as read from the egg file into the coordinate space of the node.

This is the same thing as:

get_vertex_frame() * get_node_frame_inv()

Definition at line 203 of file eggNode.I.

References LMatrix4d::ident_mat().

Referenced by EggLoader::make_polyset(), XFileVertex::set_from_egg(), and XFileNormal::set_from_egg().

const LMatrix4d * EggNode::get_vertex_to_node_ptr ( ) const [inline, inherited]

Returns either a NULL pointer or a unique pointer shared by nodes with the same get_vertex_to_node() matrix.

Definition at line 289 of file eggNode.I.

EggRenderMode::VisibilityMode EggRenderMode::get_visibility_mode ( ) const [inline, inherited]

Returns the visibility mode that was set, or VM_unspecified if nothing was set.

See set_visibility_mode().

Definition at line 99 of file eggRenderMode.I.

Referenced by EggGroup::determine_visibility_mode(), EggPrimitive::determine_visibility_mode(), EggRenderState::fill_state(), and EggRenderMode::write().

WeakReferenceList * ReferenceCount::get_weak_list ( ) const [inline, inherited]

Returns the WeakReferenceList associated with this ReferenceCount object.

If there has never been a WeakReferenceList associated with this object, creates one now.

Definition at line 307 of file referenceCount.I.

Referenced by ReferenceCount::weak_ref().

bool EggRenderMode::has_bin ( ) const [inline, inherited]

Returns true if a bin name has been set for this particular object.

See set_bin().

Definition at line 266 of file eggRenderMode.I.

Referenced by EggPrimitive::determine_bin(), EggGroup::determine_bin(), and EggRenderMode::write().

bool EggRenderMode::has_depth_offset ( ) const [inline, inherited]

Returns true if the depth-offset flag has been set for this particular object.

See set_depth_offset().

Definition at line 167 of file eggRenderMode.I.

Referenced by EggPrimitive::determine_depth_offset(), EggGroup::determine_depth_offset(), and EggRenderMode::write().

bool EggRenderMode::has_draw_order ( ) const [inline, inherited]

Returns true if the draw-order flag has been set for this particular object.

See set_draw_order().

Definition at line 216 of file eggRenderMode.I.

Referenced by EggPrimitive::determine_draw_order(), EggGroup::determine_draw_order(), and EggRenderMode::write().

bool EggPrimitive::has_material ( ) const [inline, inherited]

Returns true if the primitive is materiald (and get_material() will return a real pointer), false otherwise (and get_material() will return NULL).

Definition at line 275 of file eggPrimitive.I.

Referenced by EggRenderState::fill_state(), EggMaterialCollection::find_used_materials(), EggMaterialCollection::replace_materials(), XFileMaterial::set_from_egg(), EggPolysetMaker::sorts_less(), and EggPrimitive::write_body().

bool Namable::has_name ( ) const [inline, inherited]
bool EggPrimitive::has_normals ( ) const [virtual, inherited]

Returns true if any of the primitives (e.g.

polygons) defined within this group or below have either face or vertex normals defined, false otherwise.

Reimplemented from EggNode.

Definition at line 690 of file eggPrimitive.cxx.

bool EggPrimitive::has_primitives ( ) const [virtual, inherited]

Returns true if there are any primitives (e.g.

polygons) defined within this group or below, false otherwise.

Reimplemented from EggNode.

Definition at line 666 of file eggPrimitive.cxx.

bool EggPrimitive::has_texture ( EggTexture texture) const [inline, inherited]

Returns true if the primitive has the particular indicated texture, false otherwise.

Definition at line 166 of file eggPrimitive.I.

References EggPrimitive::find().

bool EggPrimitive::has_texture ( ) const [inline, inherited]

Returns true if the primitive has any textures specified, false otherwise.

This method is deprecated and is used in support of single-texturing only. New code should be written to use the multitexture variants instead.

Definition at line 155 of file eggPrimitive.I.

References EggPrimitive::get_num_textures().

Referenced by EggPrimitive::get_texture(), XFileVertex::set_from_egg(), and XFileMaterial::set_from_egg().

bool EggObject::has_user_data ( ) const [inherited]

Returns true if a generic user data pointer has recently been set and not yet cleared, false otherwise.

Definition at line 130 of file eggObject.cxx.

Referenced by MayaNodeTree::get_egg_group().

bool EggObject::has_user_data ( TypeHandle  type) const [inherited]

Returns true if the user data pointer of the indicated type has been set, false otherwise.

Definition at line 141 of file eggObject.cxx.

bool EggPrimitive::has_vertex_color ( ) const [inherited]

Returns true if any vertex on the primitive has a specific color set, false otherwise.

If you call unify_attributes() first, this will also return false even if all the vertices were set to the same value (since unify_attributes() removes redundant vertex properties).

Definition at line 348 of file eggPrimitive.cxx.

Referenced by EggPrimitive::get_shading(), and EggPolysetMaker::sorts_less().

bool EggPrimitive::has_vertex_normal ( ) const [inherited]

Returns true if any vertex on the primitive has a specific normal set, false otherwise.

If you call unify_attributes() first, this will also return false even if all the vertices were set to the same value (since unify_attributes() removes redundant vertex properties).

Definition at line 326 of file eggPrimitive.cxx.

Referenced by EggPrimitive::get_shading(), and EggPolysetMaker::sorts_less().

bool ReferenceCount::has_weak_list ( ) const [inline, inherited]

Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise.

In general, this will be true if there was ever a WeakPointerTo created for this object (even if there is not any for it now).

Definition at line 294 of file referenceCount.I.

Referenced by ReferenceCount::weak_unref().

bool EggNode::is_anim_matrix ( ) const [virtual, inherited]

Returns true if this node represents a table of animation transformation data, false otherwise.

Reimplemented in EggXfmAnimData, and EggXfmSAnim.

Definition at line 85 of file eggNode.cxx.

Referenced by EggTable::has_transform(), and EggTable::r_transform().

bool EggNurbsSurface::is_closed_u ( ) const

Returns true if the surface appears to be closed in the U direction.

Since the Egg syntax does not provide a means for explicit indication of closure, this has to be guessed at by examining the surface itself.

Definition at line 148 of file eggNurbsSurface.cxx.

References get_u_knot(), and get_u_order().

bool EggNurbsSurface::is_closed_v ( ) const

Returns true if the surface appears to be closed in the V direction.

Since the Egg syntax does not provide a means for explicit indication of closure, this has to be guessed at by examining the surface itself.

Definition at line 174 of file eggNurbsSurface.cxx.

References get_v_knot(), and get_v_order().

bool TypedObject::is_exact_type ( TypeHandle  handle) const [inline, inherited]
bool EggNode::is_joint ( ) const [virtual, inherited]

Returns true if this particular node represents a <Joint> entry or not.

This is a handy thing to know since Joints are sorted to the end of their sibling list when writing an egg file. See EggGroupNode::write().

Reimplemented in EggGroup.

Definition at line 74 of file eggNode.cxx.

Referenced by EggGroupNode::joint_has_primitives().

bool EggNode::is_local_coord ( ) const [inline, inherited]

Returns true if this node's vertices are not in the global coordinate space.

This will be the case if there was an <Instance> node under a transform at or above this node.

Definition at line 109 of file eggNode.I.

Referenced by EggVertex::get_num_global_coord(), EggVertex::get_num_local_coord(), EggPrimitive::r_flatten_transforms(), and EggGroup::r_flatten_transforms().

bool TypedObject::is_of_type ( TypeHandle  handle) const [inline, inherited]

Returns true if the current object is or derives from the indicated type.

Definition at line 63 of file typedObject.I.

References TypeHandle::is_derived_from().

Referenced by EggSliderData::add_back_pointer(), EggJointData::add_back_pointer(), CIntervalManager::add_c_interval(), XFileNode::add_child(), CollisionTraverser::add_collider(), CollisionHandlerPhysical::add_collider(), EggXfmSAnim::add_data(), CharacterJointBundle::add_node(), NonlinearImager::add_screen(), EggGroupNode::apply_first_attribute(), EggGroupNode::apply_last_attribute(), DeferredNodeProperty::apply_to_node(), RecorderController::begin_playback(), NodePath::clear_clip_plane(), EggGroupNode::clear_connected_shading(), NodePath::clear_light(), EggBase::convert_paths(), NodePath::decode_from_bam_stream(), VrpnClient::disconnect_device(), PhysicsManager::do_physics(), GraphicsStateGuardian::fetch_specified_part(), EggRenderState::fill_state(), AnimBundleNode::find_anim_bundle(), EggGroupNode::find_coordsys_entry(), XFile::find_data_object(), Character::find_joint(), EggGroupNode::find_materials(), Character::find_slider(), XFile::find_template(), EggGroupNode::find_textures(), EggMaterialCollection::find_used_materials(), EggTextureCollection::find_used_textures(), EggGroupNode::force_filenames(), EggJointData::force_initial_rest_frame(), WindowFramework::get_aspect_2d(), EggPoolUniquifier::get_category(), EggGroupUniquifier::get_category(), EggGroupNode::get_connected_shading(), PandaFramework::get_mouse(), FactoryParams::get_param_of_type(), EggGroupNode::has_absolute_pathnames(), NodePath::has_clip_plane(), NodePath::has_clip_plane_off(), NodePath::has_light(), PandaFramework::hide_collision_solids(), x11GraphicsWindow::open_window(), eglGraphicsWindow::open_window(), EggNode::parse_egg(), CharacterMaker::part_to_node(), EggGroupNode::post_apply_flat_attribute(), EggBinner::prepare_node(), PortalClipper::prepare_portal(), NodePath::project_texture(), EggMatrixTablePointer::quantize_channels(), ParametricCurveCollection::r_add_curves(), SceneGraphReducer::r_collect_vertex_data(), EggGroupNode::r_load_externals(), EggGroupNode::rebuild_vertex_pools(), EggGroupNode::recompute_polygon_normals(), EggGroupNode::remove_invalid_primitives(), EggGroupNode::remove_unused_vertices(), EggLoader::reparent_decals(), EggMaterialCollection::replace_materials(), EggTextureCollection::replace_textures(), EggGroupNode::resolve_filenames(), EggGroupNode::reverse_vertex_ordering(), NodePath::set_clip_plane(), NodePath::set_clip_plane_off(), NodePath::set_light(), ProjectionScreen::set_projector(), NonlinearImager::set_source_camera(), EggXfmSAnim::set_value(), NonlinearImager::set_viewer_camera(), PandaFramework::show_collision_solids(), BamCache::store(), XFileToEggConverter::strip_nodes(), EggGroupNode::strip_normals(), DataGraphTraverser::traverse(), DataGraphTraverser::traverse_below(), EggGroupNode::triangulate_polygons(), EggGroupNode::unify_attributes(), EggNameUniquifier::uniquify(), NodeCullCallbackData::upcall(), PhysicsCollisionHandler::validate_target(), EggXfmSAnim::write(), EggGroup::write(), EggToDXFLayer::write_3d_face(), and EggToDXFLayer::write_entities().

bool EggNode::is_under_instance ( ) const [inline, inherited]

Returns true if there is an <Instance> node somewhere in the egg tree at or above this node, false otherwise.

Definition at line 84 of file eggNode.I.

bool EggNode::is_under_transform ( ) const [inline, inherited]

Returns true if there is a <Transform> entry somewhere in the egg tree at or above this node, false otherwise.

Definition at line 96 of file eggNode.I.

bool EggNurbsSurface::is_valid ( ) const

Returns true if the NURBS parameters are all internally consistent (e.g.

it has the right number of vertices to match its number of knots and order in each dimension), or false otherwise.

Definition at line 110 of file eggNurbsSurface.cxx.

References get_num_cvs(), get_num_u_knots(), get_num_v_knots(), get_u_knot(), and get_v_knot().

bool EggPrimitive::joint_has_primitives ( ) const [virtual, inherited]

Returns true if there are any primitives (e.g.

polygons) defined within this group or below, but the search does not include nested joints.

Reimplemented from EggNode.

Definition at line 678 of file eggPrimitive.cxx.

void ReferenceCount::local_object ( ) [inline, inherited]

This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack.

This allows the object to be passed to functions that will increment and decrement the object's reference count temporarily, and it will prevent the object from being deleted (inappropriately), when the reference count returns to zero. It actually achieves this by setting a large positive value in the reference count field.

Definition at line 276 of file referenceCount.I.

Referenced by PGTop::cull_callback(), BoundingSphere::extend_by_hexahedron(), AsyncTaskManager::find_task(), AsyncTaskManager::find_tasks(), and AsyncTaskManager::find_tasks_matching().

bool EggAttributes::matches_color ( const EggAttributes other) const [inline, inherited]

Returns true if this color matches that of the other EggAttributes object, include the morph list.

Definition at line 146 of file eggAttributes.I.

References EggMorphList< MorphType >::compare_to(), and EggAttributes::get_color().

Referenced by EggPrimitive::do_apply_flat_attribute(), EggPrimitive::get_shading(), and EggCompositePrimitive::get_shading().

bool EggAttributes::matches_normal ( const EggAttributes other) const [inline, inherited]

Returns true if this normal matches that of the other EggAttributes object, include the morph list.

Definition at line 65 of file eggAttributes.I.

References EggMorphList< MorphType >::compare_to().

Referenced by EggPrimitive::do_apply_flat_attribute(), EggPrimitive::get_shading(), and EggCompositePrimitive::get_shading().

EggVertex * EggPrimitive::operator[] ( int  index) const [inline, inherited]

This is read-only: you can't assign directly to an indexed vertex.

See set_vertex() instead.

Definition at line 373 of file eggPrimitive.I.

References EggTextureCollection::size().

void EggNamedObject::output ( ostream &  out) const [inherited]

Outputs the Namable.

This function simply writes the name to the output stream; most Namable derivatives will probably redefine this.

Reimplemented from Namable.

Definition at line 28 of file eggNamedObject.cxx.

References Namable::has_name().

bool EggNode::parse_egg ( const string &  egg_syntax) [inherited]

Parses the egg syntax given in the indicate string as if it had been read from the egg file within this object's definition.

Updates the object accordingly. Returns true if successful, false if there was some parse error or if the object does not support this functionality.

Definition at line 267 of file eggNode.cxx.

References EggNode::egg_start_parse_body(), and TypedObject::is_of_type().

void EggPrimitive::post_apply_flat_attribute ( ) [virtual, inherited]

Intended as a followup to apply_last_attribute(), this also sets an attribute on the first vertices of the primitive, if they don't already have an attribute set, just so they end up with *something*.

Reimplemented in EggCompositePrimitive.

Definition at line 521 of file eggPrimitive.cxx.

References EggAttributes::get_color(), and EggPrimitive::get_vertex().

Referenced by EggGroupNode::post_apply_flat_attribute().

void EggPrimitive::prepare_add_vertex ( EggVertex vertex,
int  i,
int  n 
) [protected, virtual, inherited]

Marks the vertex as belonging to the primitive.

This is an internal function called by the STL-like functions push_back() and insert(), in preparation for actually adding the vertex.

i indicates the new position of the vertex in the list; n indicates the new number of vertices after the operation has completed.

Reimplemented in EggCompositePrimitive.

Definition at line 868 of file eggPrimitive.cxx.

References EggPrimitive::get_pool(), and EggVertex::get_pool().

Referenced by EggPrimitive::add_vertex(), and EggPrimitive::replace().

void EggPrimitive::prepare_remove_vertex ( EggVertex vertex,
int  i,
int  n 
) [protected, virtual, inherited]

Marks the vertex as removed from the primitive.

This is an internal function called by the STL-like functions pop_back() and erase(), in preparation for actually doing the removal.

i indicates the former position of the vertex in the list; n indicates the current number of vertices before the operation has completed.

It is an error to attempt to remove a vertex that is not already a vertex of this primitive.

Reimplemented in EggCompositePrimitive.

Definition at line 901 of file eggPrimitive.cxx.

Referenced by EggPrimitive::erase(), EggPrimitive::remove_doubled_verts(), EggPrimitive::remove_nonunique_verts(), and EggPrimitive::replace().

void EggNurbsSurface::r_apply_texmats ( EggTextureCollection textures) [protected, virtual]

The recursive implementation of apply_texmats().

Reimplemented from EggPrimitive.

Definition at line 248 of file eggNurbsSurface.cxx.

void EggPrimitive::r_flatten_transforms ( ) [protected, virtual, inherited]
void EggNode::r_mark_coordsys ( CoordinateSystem  cs) [protected, virtual, inherited]

This is only called immediately after loading an egg file from disk, to propagate the value found in the CoordinateSystem entry (or the default Y-up coordinate system) to all nodes that care about what the coordinate system is.

Reimplemented in EggGroupNode, EggXfmAnimData, and EggXfmSAnim.

Definition at line 481 of file eggNode.cxx.

void EggPrimitive::r_transform ( const LMatrix4d mat,
const LMatrix4d inv,
CoordinateSystem  to_cs 
) [protected, virtual, inherited]

This is called from within the egg code by transform().

It applies a transformation matrix to the current node in some sensible way, then continues down the tree.

The first matrix is the transformation to apply; the second is its inverse. The third parameter is the coordinate system we are changing to, or CS_default if we are not changing coordinate systems.

Reimplemented from EggNode.

Definition at line 1035 of file eggPrimitive.cxx.

References EggAttributes::transform().

void EggNode::r_transform_vertices ( const LMatrix4d mat) [protected, virtual, inherited]

This is called from within the egg code by transform_vertices_only()().

It applies a transformation matrix to the current node in some sensible way (if the current node is a vertex pool with vertices), then continues down the tree.

Reimplemented in EggGroupNode, and EggVertexPool.

Definition at line 468 of file eggNode.cxx.

Referenced by EggNode::transform(), and EggNode::transform_vertices_only().

void ReferenceCount::ref ( ) const [inline, inherited]

Explicitly increments the reference count.

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

Definition at line 179 of file referenceCount.I.

References ReferenceCount::test_ref_count_integrity().

Referenced by CachedTypedWritableReferenceCount::cache_ref(), TypedWritable::decode_raw_from_bam_stream(), NodeCachedReferenceCount::node_ref(), NodeReferenceCount::node_ref(), BamCacheRecord::set_data(), CullableObject::set_draw_callback(), and ModelRoot::set_reference().

void EggPrimitive::remove_doubled_verts ( bool  closed) [inherited]

Certain kinds of primitives, particularly polygons, don't like to have the same vertex repeated consecutively.

Unfortunately, some modeling programs (like MultiGen) make this an easy mistake to make.

It's handy to have a function to remove these redundant vertices. If closed is true, it also checks that the first and last vertices are not the same.

This function identifies repeated vertices by position only; it does not consider any other properties, such as color or UV, significant in differentiating vertices.

Definition at line 589 of file eggPrimitive.cxx.

References EggPrimitive::prepare_remove_vertex().

Referenced by EggPolygon::cleanup().

void EggPrimitive::remove_nonunique_verts ( ) [inherited]

Removes any multiple appearances of the same vertex from the primitive.

This primarily makes sense for a point primitive, which is really a collection of points and which doesn't make sense to include the same point twice, in any order.

Definition at line 636 of file eggPrimitive.cxx.

References EggPrimitive::prepare_remove_vertex().

Referenced by EggPoint::cleanup().

EggVertex * EggPrimitive::remove_vertex ( EggVertex vertex) [inherited]

Removes the indicated vertex from the primitive and returns it.

If the vertex was not already in the primitive, does nothing and returns NULL.

Definition at line 768 of file eggPrimitive.cxx.

References EggPrimitive::find(), EggVertex::test_pref_integrity(), and EggPrimitive::test_vref_integrity().

int EggNode::rename_node ( vector_string  strip_prefix) [inherited]

Rename by stripping out the prefix.

Definition at line 36 of file eggNode.cxx.

Referenced by EggGroupNode::rename_nodes().

void EggPrimitive::replace ( iterator  position,
EggVertex x 
) [inline, inherited]

Replaces the vertex at the indicated position with the indicated vertex.

It is an error to call this with an invalid position iterator (e.g. end()).

Definition at line 413 of file eggPrimitive.I.

References EggPrimitive::prepare_add_vertex(), EggPrimitive::prepare_remove_vertex(), EggVertex::test_pref_integrity(), and EggPrimitive::test_vref_integrity().

Referenced by EggVertexPool::remove_unused_vertices(), EggPrimitive::set_vertex(), and EggPrimitive::unify_attributes().

void EggPrimitive::reverse_vertex_ordering ( ) [virtual, inherited]

Reverses the ordering of the vertices in this primitive, if appropriate, in order to change the direction the polygon appears to be facing.

Does not adjust the surface normal, if any.

Definition at line 549 of file eggPrimitive.cxx.

Referenced by EggGroupNode::reverse_vertex_ordering().

void EggRenderMode::set_alpha_mode ( AlphaMode  mode) [inline, inherited]

Specifies precisely how the transparency for this geometry should be achieved, or if it should be used.

The default, AM_unspecified, is to use transparency if the geometry has a color whose alpha value is non-1, or if it has a four-channel texture applied; otherwise, AM_on forces transparency on, and AM_off forces it off. The other flavors of transparency are specific ways to turn on transparency, which may or may not be supported by a particular rendering backend.

Definition at line 118 of file eggRenderMode.I.

Referenced by TextureReference::update_egg().

void EggPrimitive::set_bface_flag ( bool  flag) [inline, inherited]

Sets the backfacing flag of the polygon.

If this is true, the polygon will be rendered so that both faces are visible; if it is false, only the front face of the polygon will be visible.

Definition at line 289 of file eggPrimitive.I.

Referenced by CLwoSurface::apply_properties(), DaeMaterials::apply_to(), and EggPrimitive::copy_attributes().

void EggRenderMode::set_bin ( const string &  bin) [inline, inherited]

Sets the "bin" string for this particular object.

This names a particular bin in which the object should be rendered. The exact meaning of a bin is implementation defined, but generally a GeomBin matching each bin name must also be specifically added to the rendering engine (e.g. the CullTraverser) in use for this to work. See also set_draw_order().

Definition at line 244 of file eggRenderMode.I.

void EggNurbsSurface::set_cv ( int  ui,
int  vi,
EggVertex vertex 
) [inline]

Redefines the control vertex associated with a particular u, v coordinate pair.

This is just a shorthand to access the EggPrimitive's normal vertex assignment for a 2-d control vertex.

Definition at line 125 of file eggNurbsSurface.I.

References get_vertex_index(), and EggPrimitive::set_vertex().

void EggRenderMode::set_depth_offset ( int  order) [inline, inherited]

Sets the "depth-offset" flag associated with this object.

This adds or subtracts an offset bias into the depth buffer. See also DepthOffsetAttrib and NodePath::set_depth_offset().

Definition at line 143 of file eggRenderMode.I.

void EggRenderMode::set_depth_test_mode ( DepthTestMode  mode) [inline, inherited]

Specifies whether this geometry should be tested against the depth buffer when it is drawn (assuming the rendering backend provides a depth buffer).

Note that this is different, and independent from, the depth_write mode.

Definition at line 61 of file eggRenderMode.I.

void EggRenderMode::set_depth_write_mode ( DepthWriteMode  mode) [inline, inherited]

Specifies whether writes should be made to the depth buffer (assuming the rendering backend provides a depth buffer) when rendering this geometry.

Definition at line 35 of file eggRenderMode.I.

void EggRenderMode::set_draw_order ( int  order) [inline, inherited]

Sets the "draw-order" flag associated with this object.

This specifies a particular order in which objects of this type should be drawn, within the specified bin. If a bin is not explicitly specified, "fixed" is used. See also set_bin().

Definition at line 193 of file eggRenderMode.I.

void EggPrimitive::set_material ( EggMaterial material) [inline, inherited]
void EggNurbsSurface::set_num_u_knots ( int  num)

Directly changes the number of knots in the U direction.

This will either add zero-valued knots onto the end, or truncate knot values from the end, depending on whether the list is being increased or decreased. If possible, it is preferable to use the setup() method instead of directly setting the number of knots, as this may result in an invalid surface.

Definition at line 63 of file eggNurbsSurface.cxx.

void EggNurbsSurface::set_num_v_knots ( int  num)

Directly changes the number of knots in the V direction.

This will either add zero-valued knots onto the end, or truncate knot values from the end, depending on whether the list is being increased or decreased. If possible, it is preferable to use the setup() method instead of directly setting the number of knots, as this may result in an invalid surface.

Definition at line 88 of file eggNurbsSurface.cxx.

void EggPrimitive::set_texture ( EggTexture texture) [inline, inherited]

Replaces the current list of textures with the indicated texture.

This method is deprecated and is used in support of single-texturing only. Please use the multitexture variant add_texture instead.

Definition at line 139 of file eggPrimitive.I.

References EggPrimitive::add_texture(), and EggPrimitive::clear_texture().

Referenced by CLwoSurface::apply_properties(), and XFileMaterial::apply_to_egg().

void EggNurbsSurface::set_u_knot ( int  k,
double  value 
) [inline]

Resets the value of the indicated knot as indicated.

k must be in the range 0 <= k < get_num_u_knots(), and the value must be in the range get_u_knot(k - 1) <= value <= get_u_knot(k + 1).

Definition at line 97 of file eggNurbsSurface.I.

void EggNurbsSurface::set_u_order ( int  u_order) [inline]

Directly changes the order in the U direction to the indicated value (which must be an integer in the range 1 <= u_order <= 4).

If possible, it is preferable to use the setup() method instead of this method, since changing the order directly may result in an invalid surface.

Definition at line 67 of file eggNurbsSurface.I.

void EggSurface::set_u_subdiv ( int  subdiv) [inline, inherited]

Sets the number of subdivisions in the U direction that will be requested across the surface.

(This doesn't necessary guarantee that this number of subdivisions will be made; it's just a hint to any surface renderer or quick tesselator.) Set the number to 0 to disable the hint.

Definition at line 65 of file eggSurface.I.

void EggObject::set_user_data ( EggUserData user_data) [inherited]

Sets the user data associated with this object.

This may be any EggUserData-derived object. The egg library will do nothing with this pointer, except to hold its reference count and return the pointer on request.

The EggObject maintains multiple different EggUserData pointers, one for each unique type (as reported by get_type()). If you know that only one type of EggUserData object will be added in your application, you may use the query functions that accept no parameters, but it is recommended that in general you pass in the type of your particular user data, to allow multiple applications to coexist in the same egg data.

This pointer is also copied by the copy assignment operator and copy constructor.

Definition at line 89 of file eggObject.cxx.

Referenced by MayaNodeTree::get_egg_group(), and EggBinner::prepare_node().

void EggNurbsSurface::set_v_knot ( int  k,
double  value 
) [inline]

Resets the value of the indicated knot as indicated.

k must be in the range 0 <= k < get_num_v_knots(), and the value must be in the range get_v_knot(k - 1) <= value <= get_v_knot(k + 1).

Definition at line 111 of file eggNurbsSurface.I.

void EggNurbsSurface::set_v_order ( int  v_order) [inline]

Directly changes the order in the V direction to the indicated value (which must be an integer in the range 1 <= v_order <= 4).

If possible, it is preferable to use the setup() method instead of this method, since changing the order directly may result in an invalid surface.

Definition at line 83 of file eggNurbsSurface.I.

void EggSurface::set_v_subdiv ( int  subdiv) [inline, inherited]

Sets the number of subdivisions in the U direction that will be requested across the surface.

(This doesn't necessary guarantee that this number of subdivisions will be made; it's just a hint to any surface renderer or quick tesselator.) Set the number to 0 to disable the hint.

Definition at line 92 of file eggSurface.I.

void EggPrimitive::set_vertex ( int  index,
EggVertex vertex 
) [inline, inherited]

Replaces a particular vertex based on its index number in the list of vertices.

This is just a convenience function for people who don't want to mess with the iterators.

Definition at line 455 of file eggPrimitive.I.

References EggPrimitive::replace(), and EggTextureCollection::size().

Referenced by EggPrimitive::do_apply_flat_attribute(), EggPrimitive::r_apply_texmats(), EggPrimitive::r_flatten_transforms(), EggGroupNode::recompute_polygon_normals(), set_cv(), and EggGroupNode::strip_normals().

void EggRenderMode::set_visibility_mode ( VisibilityMode  mode) [inline, inherited]

Specifies whether this geometry is to be considered normally visible, or hidden.

If it is hidden, it is either not loaded into the scene graph at all, or loaded as a "stashed" node, according to the setting of egg-suppress-hidden.

Definition at line 87 of file eggRenderMode.I.

Referenced by MayaNodeTree::get_egg_group().

void EggNurbsSurface::setup ( int  u_order,
int  v_order,
int  num_u_knots,
int  num_v_knots 
)

Prepares a new surface definition with the indicated order and number of knots in each dimension.

This also implies a particular number of vertices in each dimension as well (the number of knots minus the order), but it is up to the user to add the correct number of vertices to the surface by repeatedly calling push_back().

Definition at line 33 of file eggNurbsSurface.cxx.

bool EggAttributes::sorts_less_than ( const EggAttributes other) const [inline, inherited]

An ordering operator to compare two vertices for sorting order.

This imposes an arbitrary ordering useful to identify unique vertices.

Definition at line 182 of file eggAttributes.I.

References EggAttributes::compare_to().

EggRenderMode::AlphaMode EggRenderMode::string_alpha_mode ( const string &  string) [static, inherited]

Returns the AlphaMode value associated with the given string representation, or AM_unspecified if the string does not match any known AlphaMode value.

Definition at line 183 of file eggRenderMode.cxx.

Referenced by TxaLine::parse().

EggRenderMode::DepthTestMode EggRenderMode::string_depth_test_mode ( const string &  string) [static, inherited]

Returns the DepthTestMode value associated with the given string representation, or DTM_unspecified if the string does not match any known DepthTestMode value.

Definition at line 233 of file eggRenderMode.cxx.

EggRenderMode::DepthWriteMode EggRenderMode::string_depth_write_mode ( const string &  string) [static, inherited]

Returns the DepthWriteMode value associated with the given string representation, or DWM_unspecified if the string does not match any known DepthWriteMode value.

Definition at line 214 of file eggRenderMode.cxx.

EggRenderMode::VisibilityMode EggRenderMode::string_visibility_mode ( const string &  string) [static, inherited]

Returns the HiddenMode value associated with the given string representation, or VM_unspecified if the string does not match any known HiddenMode value.

Definition at line 252 of file eggRenderMode.cxx.

bool ReferenceCount::test_ref_count_integrity ( ) const [inline, inherited]
bool ReferenceCount::test_ref_count_nonzero ( ) const [inline, inherited]

Does some easy checks to make sure that the reference count isn't zero, or completely bogus.

Returns true if ok, false otherwise.

Definition at line 252 of file referenceCount.I.

References ReferenceCount::do_test_ref_count_nonzero().

Referenced by CopyOnWritePointer::test_ref_count_nonzero().

void EggNode::test_under_integrity ( ) const [inherited]

Recursively checks the integrity of the _under_flags, _parent, and _depth members of this node and all of its ancestors.

Definition at line 300 of file eggNode.cxx.

References ReferenceCount::test_ref_count_integrity(), and EggNode::test_under_integrity().

Referenced by EggNode::test_under_integrity(), EggGroup::write(), EggAnimPreload::write(), EggTable::write(), and EggXfmSAnim::write().

void EggPrimitive::test_vref_integrity ( ) const [inherited]

Verifies that each vertex in the primitive exists and that it knows it is referenced by the primitive.

Definition at line 815 of file eggPrimitive.cxx.

References EggVertex::has_pref(), and ReferenceCount::test_ref_count_integrity().

Referenced by EggPrimitive::add_vertex(), EggPrimitive::copy_vertices(), EggPrimitive::erase(), EggPrimitive::remove_vertex(), EggPrimitive::replace(), and EggPrimitive::write_body().

void EggNode::transform ( const LMatrix4d mat) [inline, inherited]

Applies the indicated transformation to the node and all of its descendants.

Reimplemented in EggVertexPool.

Definition at line 313 of file eggNode.I.

References EggNode::r_transform(), EggNode::r_transform_vertices(), and EggNode::update_under().

Referenced by SomethingToEgg::apply_units_scale(), EggToSomething::apply_units_scale(), and EggGroup::set_default_pose().

void EggAttributes::transform ( const LMatrix4d mat) [inherited]

Applies the indicated transformation matrix to the attributes.

Reimplemented in EggVertex.

Definition at line 150 of file eggAttributes.cxx.

References LVecBase3d::normalize().

Referenced by EggPrimitive::r_flatten_transforms(), and EggPrimitive::r_transform().

void EggNode::transform_vertices_only ( const LMatrix4d mat) [inline, inherited]

Applies the indicated transformation only to vertices that appear in global space within vertex pools at this node and below.

Joints and other transforms are not affected, nor are local vertices.

Definition at line 333 of file eggNode.I.

References EggNode::r_transform_vertices().

Referenced by EggTopstrip::strip_anim_vertices().

void EggPrimitive::unify_attributes ( EggPrimitive::Shading  shading) [virtual, inherited]

If the shading property is S_per_vertex, ensures that all vertices have a normal and a color, and the overall primitive does not.

If the shading property is S_per_face, and this is a composite primitive, ensures that all components have a normal and a color, and the vertices and overall primitive do not. (If this is a simple primitive, S_per_face works the same as S_overall, below).

If the shading property is S_overall, ensures that no vertices or components have a normal or a color, and the overall primitive does (if any exists at all).

After this call, either the primitive will have normals or its vertices will, but not both. Ditto for colors.

This may create redundant vertices in the vertex pool.

Reimplemented in EggCompositePrimitive.

Definition at line 383 of file eggPrimitive.cxx.

References EggAttributes::copy_color(), EggVertex::copy_grefs_from(), EggAttributes::copy_normal(), EggVertexPool::create_unique_vertex(), EggAttributes::get_color(), EggVertex::get_pool(), EggPrimitive::get_shading(), and EggPrimitive::replace().

Referenced by EggGroupNode::unify_attributes().

bool ReferenceCount::unref ( ) const [inline, virtual, inherited]

Explicitly decrements the reference count.

Note that the object will not be implicitly deleted by unref() simply because the reference count drops to zero. (Having a member function delete itself is problematic.) However, see the helper function unref_delete().

User code should avoid using ref() and unref() directly, which can result in missed reference counts. Instead, let a PointerTo object manage the reference counting automatically.

This function is const, even though it changes the object, because generally fiddling with an object's reference count isn't considered part of fiddling with the object. An object might be const in other ways, but we still need to accurately count the number of references to it.

The return value is true if the new reference count is nonzero, false if it is zero.

Reimplemented in GeomVertexArrayFormat, GeomVertexFormat, InternalName, RenderAttrib, RenderEffects, RenderState, and TransformState.

Definition at line 214 of file referenceCount.I.

References ReferenceCount::test_ref_count_integrity().

Referenced by CachedTypedWritableReferenceCount::cache_unref(), TypedWritable::decode_raw_from_bam_stream(), RenderEffect::finalize(), NodeCachedReferenceCount::node_unref(), NodeReferenceCount::node_unref(), TransformState::unref(), RenderState::unref(), RenderEffects::unref(), RenderAttrib::unref(), InternalName::unref(), GeomVertexFormat::unref(), and GeomVertexArrayFormat::unref().

void EggNode::update_under ( int  depth_offset) [protected, virtual, inherited]

This function is called from within EggGroupNode whenever the parentage of the node has changed.

It should update the depth and under_instance flags accordingly.

depth_offset is the difference between the old depth value and the new value. It should be consistent with the supplied depth value. If it is not, we have some error.

Reimplemented in EggGroupNode.

Definition at line 358 of file eggNode.cxx.

References EggNode::adjust_under(), and ReferenceCount::test_ref_count_integrity().

Referenced by EggNode::flatten_transforms(), and EggNode::transform().

void ReferenceCount::weak_ref ( WeakPointerToVoid ptv) [inline, inherited]

Adds the indicated PointerToVoid as a weak reference to this object.

Definition at line 321 of file referenceCount.I.

References WeakReferenceList::add_reference(), and ReferenceCount::get_weak_list().

void ReferenceCount::weak_unref ( WeakPointerToVoid ptv) [inline, inherited]

Removes the indicated PointerToVoid as a weak reference to this object.

It must have previously been added via a call to weak_ref().

Definition at line 334 of file referenceCount.I.

References WeakReferenceList::clear_reference(), and ReferenceCount::has_weak_list().

void EggNurbsSurface::write ( ostream &  out,
int  indent_level 
) const [virtual]

Writes the nurbsSurface to the indicated output stream in Egg format.

Implements EggPrimitive.

Definition at line 191 of file eggNurbsSurface.cxx.

References get_u_order(), EggSurface::get_u_subdiv(), get_v_order(), EggSurface::get_v_subdiv(), EggPrimitive::write_body(), and EggNamedObject::write_header().

void EggPrimitive::write_body ( ostream &  out,
int  indent_level 
) const [protected, inherited]
void EggNamedObject::write_header ( ostream &  out,
int  indent_level,
const char *  egg_keyword 
) const [inherited]

Writes the first line of the egg object, e.g.

"<Group> group_name {" or some such. It automatically enquotes the name if it contains any special characters. egg_keyword is the keyword that begins the line, e.g. "<Group>".

Definition at line 45 of file eggNamedObject.cxx.

References Namable::has_name().

Referenced by EggXfmSAnim::write(), EggXfmAnimData::write(), EggVertexPool::write(), EggTriangleStrip::write(), EggTriangleFan::write(), EggTexture::write(), EggTable::write(), EggSAnimData::write(), EggPoint::write(), write(), EggNurbsCurve::write(), EggMaterial::write(), EggLine::write(), EggGroup::write(), EggExternalReference::write(), EggComment::write(), and EggAnimPreload::write().


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations