00001
00002
00003
00004
00005
00006
00007
00008 #ifndef IMPDISPLAY_GEOMETRY_H
00009 #define IMPDISPLAY_GEOMETRY_H
00010
00011 #include "display_config.h"
00012 #include "Color.h"
00013 #include "display_macros.h"
00014 #include <IMP/PairContainer.h>
00015 #include <IMP/SingletonContainer.h>
00016 #include <IMP/RefCounted.h>
00017 #include <IMP/algebra/Vector3D.h>
00018 #include <IMP/algebra/Sphere3D.h>
00019 #include <IMP/algebra/Segment3D.h>
00020 #include <IMP/algebra/Cylinder3D.h>
00021 #include <IMP/algebra/Ellipsoid3D.h>
00022 #include <IMP/algebra/BoundingBoxD.h>
00023
00024 IMPDISPLAY_BEGIN_NAMESPACE
00025 class Geometry;
00026 typedef VectorOfRefCounted<Geometry*> Geometries;
00027 typedef std::vector<Geometry*> GeometriesTemp;
00028
00029
00030
00031
00032
00033 class IMPDISPLAYEXPORT Geometry: public Object
00034 {
00035 bool has_color_;
00036 Color color_;
00037 public:
00038
00039 Geometry(std::string name);
00040 Geometry(Color c, std::string name);
00041
00042 virtual Color get_color() const {
00043 IMP_USAGE_CHECK(has_color_, "Color not set");
00044 return color_;
00045 }
00046
00047 virtual bool get_has_color() const {
00048 return has_color_;
00049 }
00050
00051 void set_color(Color c) {
00052 has_color_=true;
00053 color_=c;
00054 }
00055
00056
00057 virtual Geometries get_components() const {return GeometriesTemp();}
00058
00059 IMP_REF_COUNTED_DESTRUCTOR(Geometry);
00060 };
00061
00062 IMP_DISPLAY_GEOMETRY_DECL(SphereGeometry, algebra::SphereD<3>);
00063 IMP_DISPLAY_GEOMETRY_DECL(CylinderGeometry, algebra::Cylinder3D);
00064 IMP_DISPLAY_GEOMETRY_DECL(EllipsoidGeometry, algebra::Ellipsoid3D);
00065
00066 IMP_DISPLAY_GEOMETRY_DECL(PointGeometry, algebra::VectorD<3>);
00067 IMP_DISPLAY_GEOMETRY_DECL(SegmentGeometry, algebra::Segment3D);
00068 IMP_DISPLAY_GEOMETRY_DECL(PolygonGeometry,
00069 std::vector<algebra::VectorD<3> >);
00070 IMP_DISPLAY_GEOMETRY_DECL(TriangleGeometry,
00071 std::vector<algebra::VectorD<3> >);
00072
00073 IMP_DISPLAY_GEOMETRY_DECOMPOSABLE_DECL(BoundingBoxGeometry,
00074 algebra::BoundingBoxD<3>);
00075
00076
00077 IMPDISPLAY_END_NAMESPACE
00078
00079 #endif