|
|
|
This is the primary interface into all the egg data, and the root of the egg file structure.
More...
#include "eggData.h"
List of all members.
Public Member Functions |
|
| EggData (const EggData ©) |
| int | collapse_equivalent_materials () |
| | Removes duplicate references to the same material with the same properties.
|
| int | collapse_equivalent_textures () |
| | Removes duplicate references to the same texture image with the same properties.
|
|
virtual TypeHandle | force_init_type () |
| bool | get_auto_resolve_externals () const |
| | Indicates whether the EggData object will automatically resolve any external references when read() is called.
|
| CoordinateSystem | get_coordinate_system () const |
| | Returns the coordinate system in which the egg file is defined.
|
| const Filename & | get_egg_filename () const |
| | Returns the directory in which the egg file is considered to reside.
|
| time_t | get_egg_timestamp () const |
| | Returns the timestamp of the egg file on disk, at the time it was opened for reading, or 0 if this information is not available.
|
|
virtual TypeHandle | get_type () const |
| bool | load_externals (const DSearchPath &searchpath=DSearchPath()) |
| | Loads up all the egg files referenced by <File> entries within the egg structure, and inserts their contents in place of the <File> entries.
|
| bool | load_externals (const DSearchPath &searchpath, BamCacheRecord *record) |
| | Loads up all the egg files referenced by <File> entries within the egg structure, and inserts their contents in place of the <File> entries.
|
| void | merge (EggData &other) |
| | Appends the other egg structure to the end of this one.
|
|
EggData & | operator= (const EggData ©) |
| bool | original_had_absolute_pathnames () const |
| | Returns true if the data processed in the last call to read() contained absolute pathnames, or false if those pathnames were all relative.
|
| bool | read (Filename filename, string display_name=string()) |
| | Opens the indicated filename and reads the egg data contents from it.
|
| bool | read (istream &in) |
| | Parses the egg syntax contained in the indicated input stream.
|
| void | recompute_polygon_normals () |
| | Recomputes all the polygon normals for polygon geometry at this group node and below so that they accurately reflect the vertex positions.
|
| void | recompute_vertex_normals (double threshold) |
| | Recomputes all the vertex normals for polygon geometry at this group node and below so that they accurately reflect the vertex positions.
|
| void | set_auto_resolve_externals (bool resolve) |
| | Indicates whether the EggData object will automatically resolve any external references when read() is called.
|
| void | set_coordinate_system (CoordinateSystem coordsys) |
| | Changes the coordinate system of the EggData.
|
| void | set_egg_filename (const Filename &egg_filename) |
| | Sets the filename--especially the directory part--in which the egg file is considered to reside.
|
| void | set_egg_timestamp (time_t egg_timestamp) |
| | Sets the timestamp of the egg file on disk, at the time it was opened for reading.
|
| void | strip_normals () |
| | Removes all normals from primitives, and the vertices they reference, at this node and below.
|
| bool | write_egg (Filename filename) |
| | The main interface for writing complete egg files.
|
| bool | write_egg (ostream &out) |
| | The main interface for writing complete egg files.
|
Static Public Member Functions |
|
static TypeHandle | get_class_type () |
| static void | init_type () |
| | This function is declared non-inline to work around a compiler bug in g++ 2.96.
|
| static bool | resolve_egg_filename (Filename &egg_filename, const DSearchPath &searchpath=DSearchPath()) |
| | Looks for the indicated filename, first along the indicated searchpath, and then along the model_path.
|
Protected Member Functions |
| virtual void | write (ostream &out, int indent_level=0) const |
| | Writes the egg data out to the indicated output stream.
|
Detailed Description
This is the primary interface into all the egg data, and the root of the egg file structure.
An EggData structure corresponds exactly with an egg file on the disk.
The EggData class inherits from EggGroupNode its collection of children, which are accessed by using the EggData itself as an STL container with begin() and end() calls. The children of the EggData class are the toplevel nodes in the egg file.
Definition at line 41 of file eggData.h.
Member Function Documentation
Indicates whether the EggData object will automatically resolve any external references when read() is called.
The default is false.
Definition at line 82 of file eggData.I.
Returns the timestamp of the egg file on disk, at the time it was opened for reading, or 0 if this information is not available.
Definition at line 159 of file eggData.I.
This function is declared non-inline to work around a compiler bug in g++ 2.96.
Making it inline seems to cause problems in the optimizer.
Reimplemented from EggGroupNode.
Definition at line 96 of file eggData.h.
References EggGroupNode::init_type().
Loads up all the egg files referenced by <File> entries within the egg structure, and inserts their contents in place of the <File> entries.
Searches for files in the searchpath, if not found directly, and writes error messages to the indicated output stream. Returns true if all externals were loaded successfully, false otherwise.
Definition at line 196 of file eggData.cxx.
References get_coordinate_system(), and EggGroupNode::r_load_externals().
Returns true if the data processed in the last call to read() contained absolute pathnames, or false if those pathnames were all relative.
This method is necessary because if auto_resolve_externals() is in effect, it may modify the pathnames to be absolute whether or not they were as loaded from disk. This method can be used to query the state of the original egg file from disk.
Definition at line 100 of file eggData.I.
Referenced by EggReader::handle_args().
Parses the egg syntax contained in the indicated input stream.
Returns true if the stream was a completely valid egg file, false if there were some errors, in which case the data may be partially read.
Before you call this routine, you should probably call set_egg_filename() to set the name of the egg file we're processing, if at all possible. If there is no such filename, you may set it to the empty string.
Definition at line 118 of file eggData.cxx.
References get_egg_filename(), and EggGroupNode::steal_children().
Recomputes all the polygon normals for polygon geometry at this group node and below so that they accurately reflect the vertex positions.
Normals are removed from the vertices and defined only on polygons, giving the geometry a faceted appearance.
This function also removes degenerate polygons that do not have enough vertices to define a normal. It does not affect normals for other kinds of primitives like Nurbs or Points.
This function does not remove or adjust vertices in the vertex pool; it only adds new vertices with the normals removed. Thus, it is a good idea to call remove_unused_vertices() after calling this.
Definition at line 208 of file eggData.I.
Recomputes all the vertex normals for polygon geometry at this group node and below so that they accurately reflect the vertex positions.
A shared edge between two polygons (even in different groups) is considered smooth if the angle between the two edges is less than threshold degrees.
This function also removes degenerate polygons that do not have enough vertices to define a normal. It does not affect normals for other kinds of primitives like Nurbs or Points.
This function does not remove or adjust vertices in the vertex pool; it only adds new vertices with the correct normals. Thus, it is a good idea to call remove_unused_vertices() after calling this.
Definition at line 184 of file eggData.I.
Sets the filename--especially the directory part--in which the egg file is considered to reside.
This is also implicitly set by read().
Definition at line 124 of file eggData.I.
Referenced by read().
Sets the timestamp of the egg file on disk, at the time it was opened for reading.
This is also implicitly set by read().
Definition at line 147 of file eggData.I.
Referenced by read().
Removes all normals from primitives, and the vertices they reference, at this node and below.
This function does not remove or adjust vertices in the vertex pool; it only adds new vertices with the normal removed. Thus, it is a good idea to call remove_unused_vertices() after calling this.
Reimplemented from EggGroupNode.
Definition at line 224 of file eggData.I.
| void EggData::write |
( |
ostream & |
out, |
|
|
int |
indent_level = 0 |
|
) |
| const [protected, virtual] |
The main interface for writing complete egg files.
Definition at line 264 of file eggData.cxx.
References write().
The documentation for this class was generated from the following files:
| | |