Panda3D
 All Classes Functions Variables Enumerations
eggPoint.cxx
00001 // Filename: eggPoint.cxx
00002 // Created by:  drose (15Dec99)
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 "eggPoint.h"
00016 
00017 #include "indent.h"
00018 
00019 TypeHandle EggPoint::_type_handle;
00020 
00021 
00022 ////////////////////////////////////////////////////////////////////
00023 //     Function: EggPoint::cleanup
00024 //       Access: Public, Virtual
00025 //  Description: Cleans up modeling errors in whatever context this
00026 //               makes sense.  For instance, for a polygon, this calls
00027 //               remove_doubled_verts(true).  For a point, it calls
00028 //               remove_nonunique_verts().  Returns true if the
00029 //               primitive is valid, or false if it is degenerate.
00030 ////////////////////////////////////////////////////////////////////
00031 bool EggPoint::
00032 cleanup() {
00033   remove_nonunique_verts();
00034   return !empty();
00035 }
00036 
00037 ////////////////////////////////////////////////////////////////////
00038 //     Function: EggPoint::write
00039 //       Access: Public, Virtual
00040 //  Description: Writes the point to the indicated output stream in
00041 //               Egg format.
00042 ////////////////////////////////////////////////////////////////////
00043 void EggPoint::
00044 write(ostream &out, int indent_level) const {
00045   write_header(out, indent_level, "<PointLight>");
00046 
00047   if (has_thick()) {
00048     indent(out, indent_level + 2) 
00049       << "<Scalar> thick { " << get_thick() << " }\n";
00050   }
00051 
00052   if (has_perspective()) {
00053     indent(out, indent_level + 2) 
00054       << "<Scalar> perspective { " << get_perspective() << " }\n";
00055   }
00056 
00057   write_body(out, indent_level + 2);
00058   indent(out, indent_level) << "}\n";
00059 }
 All Classes Functions Variables Enumerations