IMP logo
IMP Reference Guide  2.13.0
The Integrative Modeling Platform
GeometryProcessor.h
Go to the documentation of this file.
1 /**
2  * \file IMP/display/GeometryProcessor.h
3  * \brief Provide a standard geometry processing framework.
4  *
5  * Copyright 2007-2020 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPDISPLAY_GEOMETRY_PROCESSOR_H
9 #define IMPDISPLAY_GEOMETRY_PROCESSOR_H
10 
11 #include <IMP/display/display_config.h>
12 #include "declare_Geometry.h"
13 #include "primitive_geometries.h"
14 
15 IMPDISPLAY_BEGIN_NAMESPACE
16 
17 //! Provide a standard geometry processing framework.
18 /** This class is designed to be used as a mixin, so
19  inherit from this and overload various process methods
20  as needed.
21  */
22 class IMPDISPLAYEXPORT GeometryProcessor {
23  protected:
24  ~GeometryProcessor() {}
25 
26  virtual bool handle_sphere(SphereGeometry *, Color, std::string) {
27  return false;
28  }
29  virtual bool handle_cylinder(CylinderGeometry *, Color, std::string) {
30  return false;
31  }
32  virtual bool handle_point(PointGeometry *, Color, std::string) {
33  return false;
34  }
35  virtual bool handle_segment(SegmentGeometry *, Color, std::string) {
36  return false;
37  }
38  virtual bool handle_polygon(PolygonGeometry *, Color, std::string) {
39  return false;
40  }
41  virtual bool handle_triangle(TriangleGeometry *, Color, std::string) {
42  return false;
43  }
44  virtual bool handle_surface_mesh(SurfaceMeshGeometry *, Color, std::string) {
45  return false;
46  }
47  virtual bool handle_label(LabelGeometry *, Color, std::string) {
48  return false;
49  }
50  virtual bool handle_ellipsoid(EllipsoidGeometry *, Color, std::string) {
51  return false;
52  }
53  virtual bool handle_bounding_box(BoundingBoxGeometry *, Color, std::string) {
54  return false;
55  }
56  virtual bool handle_anything(Geometry *, Color, std::string) { return false; }
57  void handle_geometry(Geometry *g);
58 
59  private:
60  void handle_geometry_internal(Geometry *g, bool has_color, Color c,
61  std::string);
62 };
63 #ifndef IMP_DOXYGEN
64 typedef Vector<GeometryProcessor> GeometryProcessors;
65 #endif
66 IMPDISPLAY_END_NAMESPACE
67 
68 #endif /* IMPDISPLAY_GEOMETRY_PROCESSOR_H */
Represent an RGB color.
Definition: Color.h:24
The base class for geometry.
A more IMP-like version of the std::vector.
Definition: Vector.h:39
Implement geometry for the basic shapes from IMP.algebra.
Provide a standard geometry processing framework.
Implement geometry for the basic shapes from IMP.algebra.
A text label for a ball in space.