This is the first bead in the file, the top of the bead hierarchy, and the primary interface to reading and writing a Flt file.
More...
Public Types |
| enum | AttrUpdate { AU_none,
AU_if_missing,
AU_always
} |
| enum | DatabaseOrigin {
DO_open_flight = 100,
DO_dig = 200,
DO_es_ct6 = 300,
DO_psp = 400,
DO_ge_civ = 600,
DO_es_gdf = 700
} |
| enum | EarthModel {
EM_wgs84 = 0,
EM_wgs72 = 1,
EM_bessel = 2,
EM_clarke_1866 = 3,
EM_nad27 = 4
} |
| enum | Flags { F_save_vertex_normals = 0x80000000
} |
| enum | ProjectionType {
PT_flat_earth = 0,
PT_trapezoidal = 1,
PT_round_earth = 2,
PT_lambert = 3,
PT_utm = 4
} |
| enum | Units {
U_meters = 0,
U_kilometers = 1,
U_feet = 4,
U_inches = 5,
U_nautical_miles = 8
} |
| enum | VertexStorageType { VTS_double = 1
} |
Public Member Functions |
| | FltHeader (PathReplace *path_replace) |
| | The FltHeader constructor accepts a PathReplace pointer; it uses this object to automatically convert all external filename and texture references.
|
| void | add_instance (FltInstanceDefinition *instance) |
| | Defines a new instance subtree.
|
| void | add_light_source (FltLightSourceDefinition *light_source) |
| | Defines a new light source.
|
| void | add_material (FltMaterial *material) |
| | Defines a new material.
|
| void | add_texture (FltTexture *texture) |
| | Defines a new texture.
|
| void | add_vertex (FltVertex *vertex) |
| | Adds a new vertex to the end of the vertex palette.
|
| virtual void | apply_converted_filenames () |
| | Walks the hierarchy at this record and below and copies the _converted_filename record into the _orig_filename record, so the flt file will be written out with the converted filename instead of what was originally read in.
|
| bool | check_version () const |
| | Verifies that the version number read from the header is an understood version number, and prints a warning to the user if this is not so--the read may or may not succeed.
|
| void | clear_instances () |
| | Removes all instance subtrees from the instance pool.
|
| void | clear_light_sources () |
| | Removes all light sources from the palette.
|
| void | clear_materials () |
| | Removes all materials from the palette.
|
| void | clear_textures () |
| | Removes all textures from the palette.
|
| void | clear_vertices () |
| | Removes all vertices from the vertex palette.
|
| Filename | convert_path (const Filename &orig_filename, const DSearchPath &additional_path=DSearchPath()) |
| | Uses the PathReplace object to convert the named filename as read from the flt record to its actual name.
|
|
virtual TypeHandle | force_init_type () |
| AttrUpdate | get_auto_attr_update () const |
| | Returns the current setting of the auto_attr_update flag.
|
| int | get_closest_color (const LColor &color) const |
| | Returns the color index of the nearest color in the palette that matches the given four-component color, including alpha.
|
| int | get_closest_rgb (const LRGBColor &color) const |
| | Returns the color index of the nearest color in the palette that matches the given three-component color, ignoring alpha.
|
| LColor | get_color (int color_index) const |
| | Returns the four-component color corresponding to the given color index.
|
| LColor | get_color (int color_index, bool use_packed_color, const FltPackedColor &packed_color, int transparency) |
| | Decodes a MultiGen color, as stored on a face or vertex, into an actual four-component LColor.
|
| string | get_color_name (int color_index) const |
| | Returns the name associated with the given color, if any.
|
| FltEyepoint * | get_eyepoint (int n) |
| | Returns the nth eyepoint in the eyepoint/trackplane palette.
|
| const Filename & | get_flt_filename () const |
| | Returns the directory in which the flt file is considered to reside.
|
| int | get_flt_version () const |
| | Returns the version number of the flt file as reported in the header, times 100.
|
| FltInstanceDefinition * | get_instance (int instance_index) const |
| | Returns the instance subtree associated with the given index, or NULL if there is no such instance.
|
| FltLightSourceDefinition * | get_light_source (int light_index) const |
| | Returns the light source associated with the given index, or NULL if there is no such light source.
|
| FltMaterial * | get_material (int material_index) const |
| | Returns the material associated with the given index, or NULL if there is no such material.
|
| int | get_num_color_entries () const |
| | Returns the number of actual entries in the color palette.
|
| int | get_num_color_shades () const |
| | Returns the number of shades of brightness of each entry in the color palette.
|
| int | get_num_colors () const |
| | Returns the total number of different colors in the color palette.
|
| int | get_num_eyepoints () const |
| | Returns the number of eyepoints in the eyepoint/trackplane palette.
|
| int | get_num_trackplanes () const |
| | Returns the number of trackplanes in the eyepoint/trackplane palette.
|
| int | get_num_vertices () const |
| | Returns the number of vertices in the vertex palette.
|
| int | get_offset_by_vertex (FltVertex *vertex) |
| | Returns the byte offset into the vertex palette associated with the given vertex pointer.
|
| PathReplace * | get_path_replace () |
| | Returns a pointer to the PathReplace object associated with this converter.
|
| const PathReplace * | get_path_replace () const |
| | Returns a pointer to the PathReplace object associated with this converter.
|
| LRGBColor | get_rgb (int color_index) const |
| | Returns the three-component color corresponding to the given color index, ignoring the alpha component.
|
| LRGBColor | get_rgb (int color_index, bool use_packed_color, const FltPackedColor &packed_color) |
| | Decodes a MultiGen color, as stored on a face or vertex, into an actual three-component LRGBColor.
|
| FltTexture * | get_texture (int texture_index) const |
| | Returns the texture associated with the given index, or NULL if there is no such texture.
|
| FltTrackplane * | get_trackplane (int n) |
| | Returns the nth trackplane in the eyepoint/trackplane palette.
|
|
virtual TypeHandle | get_type () const |
| DistanceUnit | get_units () const |
| | Returns the units indicated by the flt header, or DU_invalid if the units in the header are not understood.
|
| FltVertex * | get_vertex (int n) const |
| | Returns the nth vertex of the vertex palette.
|
| FltVertex * | get_vertex_by_offset (int offset) |
| | Returns the particular vertex pointer associated with the given byte offset into the vertex palette.
|
| bool | got_eyepoint_trackplane_palette () const |
| | Returns true if we have read an eyepoint/trackplane palette, and at least some of the eyepoints and trackplanes are therefore expected to be meaningful.
|
| bool | has_color_name (int color_index) const |
| | Returns true if the given color is named, false otherwise.
|
| bool | has_instance (int instance_index) const |
| | Returns true if a instance subtree with the given index has been defined.
|
| bool | has_light_source (int light_index) const |
| | Returns true if a light source with the given index has been defined.
|
| bool | has_material (int material_index) const |
| | Returns true if a material with the given index has been defined.
|
| bool | has_texture (int texture_index) const |
| | Returns true if a texture with the given index has been defined.
|
| FltError | read_flt (Filename filename) |
| | Opens the indicated filename for reading and attempts to read the complete Flt file.
|
| FltError | read_flt (istream &in) |
| | Attempts to read a complete Flt file from the already-opened stream.
|
| void | remove_instance (int instance_index) |
| | Removes a particular instance subtree from the pool, if it exists.
|
| void | remove_light_source (int light_index) |
| | Removes a particular light source from the light source palette, if it exists.
|
| void | remove_material (int material_index) |
| | Removes a particular material from the material palette, if it exists.
|
| void | remove_texture (int texture_index) |
| | Removes a particular texture from the texture palette, if it exists.
|
| void | set_auto_attr_update (AttrUpdate attr) |
| | Controls whether texture .attr files are written automatically when write_flt() is called.
|
| void | set_eyepoint_trackplane_palette (bool flag) |
| | Sets the state of the eyepoint/trackplane palette flag.
|
| void | set_flt_filename (const Filename &flt_filename) |
| | Sets the filename--especially the directory part--in which the flt file is considered to reside.
|
| void | set_flt_version (int version) |
| | Changes the version number of the flt file that will be reported in the header.
|
| void | set_path_replace (PathReplace *path_replace) |
| | Replaces the PathReplace object (which specifies how to mangle paths from the source to the destination file) with a new one.
|
| FltError | write_flt (Filename filename) |
| | Opens the indicated filename for writing and attempts to write the complete Flt file.
|
| FltError | write_flt (ostream &out) |
| | Attempts to write a complete Flt file to the already-opened stream.
|
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 int | max_flt_version () |
| | Returns the latest flt version number that this codebase is known to support (times 100).
|
| static int | min_flt_version () |
| | Returns the earliest flt version number that this codebase supports (times 100).
|
Public Attributes |
|
DatabaseOrigin | _database_origin |
|
double | _delta_x |
|
double | _delta_y |
|
double | _delta_z |
|
EarthModel | _earth_model |
|
int | _edit_revision_level |
|
unsigned int | _flags |
|
int | _format_revision_level |
|
double | _lambert_lower_lat |
|
double | _lambert_upper_lat |
|
string | _last_revision |
|
double | _ne_lat |
|
double | _ne_long |
|
int | _next_adaptive_id |
|
int | _next_bsp_id |
|
int | _next_cat_id |
|
int | _next_clip_id |
|
int | _next_curve_id |
|
int | _next_dof_id |
|
int | _next_face_id |
|
int | _next_group_id |
|
int | _next_light_id |
|
int | _next_lod_id |
|
int | _next_mesh_id |
|
int | _next_object_id |
|
int | _next_path_id |
|
int | _next_road_id |
|
int | _next_sound_id |
|
int | _next_switch_id |
|
int | _next_text_id |
|
double | _origin_lat |
|
double | _origin_long |
|
ProjectionType | _projection_type |
|
double | _radius |
|
double | _sw_lat |
|
double | _sw_long |
|
double | _sw_x |
|
double | _sw_y |
|
bool | _texwhite_new |
|
int | _unit_multiplier |
|
VertexStorageType | _vertex_storage_type |
|
Units | _vertex_units |
Protected Member Functions |
| virtual bool | build_record (FltRecordWriter &writer) const |
| | Fills up the current record on the FltRecordWriter with data for this record, but does not advance the writer.
|
| virtual bool | extract_ancillary (FltRecordReader &reader) |
| | Checks whether the given bead, which follows this bead sequentially in the file, is an ancillary record of this bead.
|
| virtual bool | extract_record (FltRecordReader &reader) |
| | Fills in the information in this bead based on the information given in the indicated datagram, whose opcode has already been read.
|
| virtual FltError | write_ancillary (FltRecordWriter &writer) const |
| | Writes whatever ancillary records are required for this bead.
|
This is the first bead in the file, the top of the bead hierarchy, and the primary interface to reading and writing a Flt file.
You always read a Flt file by creating a header and calling read_flt(), which fills in its children beads automatically; you write a Flt file by creating a header, adding its children, and calling write_flt().
Definition at line 48 of file fltHeader.h.