Panda3D
 All Classes Functions Variables Enumerations
eggSingleBase.cxx
1 // Filename: eggSingleBase.cxx
2 // Created by: drose (21Jul03)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "eggSingleBase.h"
16 
17 #include "eggGroupNode.h"
18 #include "eggTexture.h"
19 #include "eggFilenameNode.h"
20 #include "eggComment.h"
21 #include "dcast.h"
22 #include "string_utils.h"
23 
24 ////////////////////////////////////////////////////////////////////
25 // Function: EggSingleBase::Constructor
26 // Access: Public
27 // Description:
28 ////////////////////////////////////////////////////////////////////
29 EggSingleBase::
30 EggSingleBase() :
31  _data(new EggData)
32 {
33 }
34 
35 ////////////////////////////////////////////////////////////////////
36 // Function: EggSingleBase::as_reader
37 // Access: Public, Virtual
38 // Description: Returns this object as an EggReader pointer, if it is
39 // in fact an EggReader, or NULL if it is not.
40 //
41 // This is intended to work around the C++ limitation
42 // that prevents downcasts past virtual inheritance.
43 // Since both EggReader and EggWriter inherit virtually
44 // from EggSingleBase, we need functions like this to downcast
45 // to the appropriate pointer.
46 ////////////////////////////////////////////////////////////////////
49  return (EggReader *)NULL;
50 }
51 
52 ////////////////////////////////////////////////////////////////////
53 // Function: EggSingleBase::as_writer
54 // Access: Public, Virtual
55 // Description: Returns this object as an EggWriter pointer, if it is
56 // in fact an EggWriter, or NULL if it is not.
57 //
58 // This is intended to work around the C++ limitation
59 // that prevents downcasts past virtual inheritance.
60 // Since both EggReader and EggWriter inherit virtually
61 // from EggSingleBase, we need functions like this to downcast
62 // to the appropriate pointer.
63 ////////////////////////////////////////////////////////////////////
66  return (EggWriter *)NULL;
67 }
68 
69 ////////////////////////////////////////////////////////////////////
70 // Function: EggSingleBase::post_command_line
71 // Access: Protected, Virtual
72 // Description:
73 ////////////////////////////////////////////////////////////////////
74 bool EggSingleBase::
75 post_command_line() {
76  if (_got_coordinate_system) {
77  _data->set_coordinate_system(_coordinate_system);
78  }
79 
80  return EggBase::post_command_line();
81 }
82 
This is the primary interface into all the egg data, and the root of the egg file structure...
Definition: eggData.h:41
virtual EggReader * as_reader()
Returns this object as an EggReader pointer, if it is in fact an EggReader, or NULL if it is not...
virtual EggWriter * as_writer()
Returns this object as an EggWriter pointer, if it is in fact an EggWriter, or NULL if it is not...
This is the base class for a program that reads egg files, but doesn't write an egg file...
Definition: eggReader.h:30
This is the base class for a program that generates an egg file output, but doesn't read any for inpu...
Definition: eggWriter.h:30