Panda3D
Loading...
Searching...
No Matches
Public Member Functions | List of all members
DXFToEggConverter Class Reference

This class supervises the construction of an EggData structure from a DXF file. More...

#include "dxfToEggConverter.h"

Inheritance diagram for DXFToEggConverter:
SomethingToEggConverter DXFFile MemoryBase

Public Member Functions

 DXFToEggConverter (const DXFToEggConverter &copy)
 
virtual bool convert_file (const Filename &filename)
 Handles the reading of the input file and converting it to egg.
 
virtual std::string get_extension () const
 Returns the common extension of the file type this converter supports.
 
virtual std::string get_name () const
 Returns the English name of the file type this converter supports.
 
virtual SomethingToEggConvertermake_copy ()
 Allocates and returns a new copy of the converter.
 
virtual bool supports_compressed () const
 Returns true if this file type can transparently load compressed files (with a .pz extension), false otherwise.
 
- Public Member Functions inherited from SomethingToEggConverter
 SomethingToEggConverter (const SomethingToEggConverter &copy)
 
void clear_egg_data ()
 Sets the EggData to NULL and makes the converter invalid.
 
void clear_end_frame ()
 Removes the value previously set by set_end_frame().
 
void clear_error ()
 Resets the error flag to the no-error state.
 
void clear_frame_inc ()
 Removes the value previously set by set_frame_inc().
 
void clear_input_frame_rate ()
 Removes the value previously set by set_input_frame_rate().
 
void clear_neutral_frame ()
 Removes the value previously set by set_neutral_frame().
 
void clear_output_frame_rate ()
 Removes the value previously set by set_output_frame_rate().
 
void clear_start_frame ()
 Removes the value previously set by set_start_frame().
 
Filename convert_model_path (const Filename &orig_filename)
 Converts the indicated model filename to a relative or absolute or whatever filename, according to _path_replace.
 
virtual std::string get_additional_extensions () const
 Returns a space-separated list of extension, in addition to the one returned by get_extension(), that are recognized by this converter.
 
AnimationConvert get_animation_convert () const
 Returns how source animation will be converted into egg structures.
 
const std::string & get_character_name () const
 Returns the name of the character generated.
 
EggDataget_egg_data ()
 Returns the EggData structure.
 
double get_end_frame () const
 Returns the value set by a previous call to set_end_frame().
 
double get_frame_inc () const
 Returns the value set by a previous call to set_frame_inc().
 
double get_input_frame_rate () const
 Returns the value set by a previous call to set_input_frame_rate().
 
virtual DistanceUnit get_input_units ()
 This may be called after convert_file() has been called and returned true, indicating a successful conversion.
 
bool get_merge_externals () const
 Returns the current state of the merge_externals flag.
 
double get_neutral_frame () const
 Returns the value set by a previous call to set_neutral_frame().
 
double get_output_frame_rate () const
 Returns the value set by a previous call to set_output_frame_rate().
 
PathReplaceget_path_replace ()
 Returns a pointer to the PathReplace object associated with this converter.
 
const PathReplaceget_path_replace () const
 Returns a pointer to the PathReplace object associated with this converter.
 
double get_start_frame () const
 Returns the value set by a previous call to set_start_frame().
 
bool had_error () const
 Returns true if an error was detected during the conversion process (unless _allow_errors is true), false otherwise.
 
bool handle_external_reference (EggGroupNode *egg_parent, const Filename &ref_filename)
 Handles an external reference in the source file.
 
bool has_end_frame () const
 Returns true if the ending frame has been explicitly specified via set_end_frame(), or false if the ending frame should be implicit based on the source.
 
bool has_frame_inc () const
 Returns true if the frame increment has been explicitly specified via set_frame_inc(), or false if the ending frame should be implicit based on the source.
 
bool has_input_frame_rate () const
 Returns true if the frame rate has been explicitly specified via set_input_frame_rate(), or false otherwise.
 
bool has_neutral_frame () const
 Returns true if the neutral frame has been explicitly specified via set_neutral_frame(), or false otherwise.
 
bool has_output_frame_rate () const
 Returns true if the frame rate has been explicitly specified via set_output_frame_rate(), or false otherwise.
 
bool has_start_frame () const
 Returns true if the starting frame has been explicitly specified via set_start_frame(), or false if the starting frame should be implicit based on the source.
 
virtual PT (PandaNode) convert_to_node(const LoaderOptions &options
 
void set_animation_convert (AnimationConvert animation_convert)
 Specifies how source animation will be converted into egg structures.
 
void set_character_name (const std::string &character_name)
 Specifies the name of the character generated.
 
void set_egg_data (EggData *egg_data)
 Sets the egg data that will be filled in when convert_file() is called.
 
void set_end_frame (double end_frame)
 Specifies the ending frame of the animation to convert, in the units specified by set_input_frame_rate().
 
void set_frame_inc (double frame_inc)
 Specifies the increment between frames to extract.
 
void set_input_frame_rate (double input_frame_rate)
 Specifies the number of frames per second that is represented by the "frame" unit in the animation package.
 
void set_merge_externals (bool merge_externals)
 Sets the merge_externals flag.
 
void set_neutral_frame (double neutral_frame)
 Specifies the frame of animation to represent the neutral pose of the model.
 
void set_output_frame_rate (double output_frame_rate)
 Specifies the number of frames per second that the resulting animation should be played at.
 
void set_path_replace (PathReplace *path_replace)
 Replaces the PathReplace object (which specifies how to mangle paths from the source to the destination egg file) with a new one.
 
void set_start_frame (double start_frame)
 Specifies the starting frame of the animation to convert, in the units specified by set_input_frame_rate().
 
virtual bool supports_convert_to_node (const LoaderOptions &options) const
 Returns true if this converter can directly convert the model type to internal Panda memory structures, given the indicated options, or false otherwise.
 
- Public Member Functions inherited from DXFFile
virtual void begin_file ()
 A hook for user code, if desired.
 
virtual void begin_section ()
 A hook for user code, if desired.
 
virtual void done_vertex ()
 A hook for user code, if desired.
 
virtual void end_file ()
 A hook for user code, if desired.
 
virtual void end_section ()
 A hook for user code, if desired.
 
const Colorget_color () const
 This is a convenience function to return the r,g,b color of the current entity (at the time of done_entity()).
 
void ocs_2_wcs ()
 Assuming the current entity is a planar-based entity, for instance, a 2-d polygon (as opposed to a 3-d polygon), this converts the coordinates from the funny planar coordinate system to the world coordinates.
 
void process (Filename filename)
 Opens the indicated filename and reads it as a DXF file.
 
void process (std::istream *in, bool owns_in)
 Reads the indicated stream as a DXF file.
 
- Public Member Functions inherited from MemoryBase
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 * operator new[] (size_t size, void *ptr)
 

Additional Inherited Members

- Public Types inherited from DXFFile
enum  Entity {
  EN_unknown , EN_3dface , EN_point , EN_insert ,
  EN_vertex , EN_polyline
}
 
enum  PolylineFlags {
  PF_closed = 0x01 , PF_curve_fit = 0x02 , PF_spline_fit = 0x04 , PF_3d = 0x08 ,
  PF_3d_mesh = 0x10 , PF_closed_n = 0x20 , PF_polyface = 0x40 , PF_continuous_linetype = 0x80
}
 
enum  Section {
  SE_unknown , SE_header , SE_tables , SE_blocks ,
  SE_entities , SE_objects
}
 
enum  State {
  ST_top , ST_section , ST_entity , ST_verts ,
  ST_error , ST_done
}
 
- Static Public Member Functions inherited from SomethingToEggConverter
static double get_default_frame_rate ()
 Returns the default frame rate if nothing is specified for input_frame_rate or output_frame_rate, and the animation package does not have an implicit frame rate.
 
- Static Public Member Functions inherited from DXFFile
static int find_color (double r, double g, double b)
 Returns the index of the closest matching AutoCAD color to the indicated r, g, b.
 
- Public Attributes inherited from SomethingToEggConverter
bool _allow_errors
 
virtual const Filenamefilename
 
- Public Attributes inherited from DXFFile
int _color_index
 
Entity _entity
 
int _flags
 
DXFLayer_layer
 
DXFLayerMap _layers
 
LPoint3d _p
 
LPoint3d _q
 
LPoint3d _r
 
LPoint3d _s
 
Section _section
 
DXFVertices _verts
 
LVector3d _z
 
- Static Public Attributes inherited from DXFFile
static Color _colors [DXF_num_colors]
 

Detailed Description

This class supervises the construction of an EggData structure from a DXF file.

Definition at line 26 of file dxfToEggConverter.h.

Constructor & Destructor Documentation

◆ DXFToEggConverter() [1/2]

DXFToEggConverter::DXFToEggConverter ( )

Definition at line 21 of file dxfToEggConverter.cxx.

◆ DXFToEggConverter() [2/2]

DXFToEggConverter::DXFToEggConverter ( const DXFToEggConverter & copy)

Definition at line 28 of file dxfToEggConverter.cxx.

◆ ~DXFToEggConverter()

DXFToEggConverter::~DXFToEggConverter ( )

Definition at line 37 of file dxfToEggConverter.cxx.

Member Function Documentation

◆ convert_file()

bool DXFToEggConverter::convert_file ( const Filename & filename)
virtual

Handles the reading of the input file and converting it to egg.

Returns true if successful, false otherwise.

Implements SomethingToEggConverter.

Definition at line 79 of file dxfToEggConverter.cxx.

References SomethingToEggConverter::clear_error(), SomethingToEggConverter::had_error(), and DXFFile::process().

◆ get_extension()

std::string DXFToEggConverter::get_extension ( ) const
virtual

Returns the common extension of the file type this converter supports.

Implements SomethingToEggConverter.

Definition at line 61 of file dxfToEggConverter.cxx.

◆ get_name()

std::string DXFToEggConverter::get_name ( ) const
virtual

Returns the English name of the file type this converter supports.

Implements SomethingToEggConverter.

Definition at line 53 of file dxfToEggConverter.cxx.

◆ make_copy()

SomethingToEggConverter * DXFToEggConverter::make_copy ( )
virtual

Allocates and returns a new copy of the converter.

Implements SomethingToEggConverter.

Definition at line 44 of file dxfToEggConverter.cxx.

◆ supports_compressed()

bool DXFToEggConverter::supports_compressed ( ) const
virtual

Returns true if this file type can transparently load compressed files (with a .pz extension), false otherwise.

Reimplemented from SomethingToEggConverter.

Definition at line 70 of file dxfToEggConverter.cxx.


The documentation for this class was generated from the following files: