Panda3D
|
00001 // Filename: eggSingleBase.cxx 00002 // Created by: drose (21Jul03) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #include "eggSingleBase.h" 00016 00017 #include "eggGroupNode.h" 00018 #include "eggTexture.h" 00019 #include "eggFilenameNode.h" 00020 #include "eggComment.h" 00021 #include "dcast.h" 00022 #include "string_utils.h" 00023 00024 //////////////////////////////////////////////////////////////////// 00025 // Function: EggSingleBase::Constructor 00026 // Access: Public 00027 // Description: 00028 //////////////////////////////////////////////////////////////////// 00029 EggSingleBase:: 00030 EggSingleBase() : 00031 _data(new EggData) 00032 { 00033 } 00034 00035 //////////////////////////////////////////////////////////////////// 00036 // Function: EggSingleBase::as_reader 00037 // Access: Public, Virtual 00038 // Description: Returns this object as an EggReader pointer, if it is 00039 // in fact an EggReader, or NULL if it is not. 00040 // 00041 // This is intended to work around the C++ limitation 00042 // that prevents downcasts past virtual inheritance. 00043 // Since both EggReader and EggWriter inherit virtually 00044 // from EggSingleBase, we need functions like this to downcast 00045 // to the appropriate pointer. 00046 //////////////////////////////////////////////////////////////////// 00047 EggReader *EggSingleBase:: 00048 as_reader() { 00049 return (EggReader *)NULL; 00050 } 00051 00052 //////////////////////////////////////////////////////////////////// 00053 // Function: EggSingleBase::as_writer 00054 // Access: Public, Virtual 00055 // Description: Returns this object as an EggWriter pointer, if it is 00056 // in fact an EggWriter, or NULL if it is not. 00057 // 00058 // This is intended to work around the C++ limitation 00059 // that prevents downcasts past virtual inheritance. 00060 // Since both EggReader and EggWriter inherit virtually 00061 // from EggSingleBase, we need functions like this to downcast 00062 // to the appropriate pointer. 00063 //////////////////////////////////////////////////////////////////// 00064 EggWriter *EggSingleBase:: 00065 as_writer() { 00066 return (EggWriter *)NULL; 00067 } 00068 00069 //////////////////////////////////////////////////////////////////// 00070 // Function: EggSingleBase::post_command_line 00071 // Access: Protected, Virtual 00072 // Description: 00073 //////////////////////////////////////////////////////////////////// 00074 bool EggSingleBase:: 00075 post_command_line() { 00076 if (_got_coordinate_system) { 00077 _data->set_coordinate_system(_coordinate_system); 00078 } 00079 00080 return EggBase::post_command_line(); 00081 } 00082