IMP  2.0.0
The Integrative Modeling Platform
FilterGeometry.h
Go to the documentation of this file.
1 /**
2  * \file IMP/display/FilterGeometry.h
3  * \brief Implement FilterGeometry
4  *
5  * Copyright 2007-2013 IMP Inventors. All rights reserved.
6  */
7 
8 #ifndef IMPDISPLAY_FILTER_GEOMETRY_H
9 #define IMPDISPLAY_FILTER_GEOMETRY_H
10 
11 #include <IMP/display/display_config.h>
12 #include "declare_Geometry.h"
13 #include "GeometryProcessor.h"
14 
15 #include <IMP/PairContainer.h>
16 #include <IMP/SingletonContainer.h>
17 #include <IMP/algebra/Plane3D.h>
19 
20 IMPDISPLAY_BEGIN_NAMESPACE
21 
22 //! Remove geometry which is not above a plane.
23 /** Any geometry which is not above the plane is not passed on to the writer
24  or log or whatever this CompoundGoemetry is passed to.
25  */
26 class IMPDISPLAYEXPORT FilterGeometry: public GeometryProcessor,
27  public Geometry
28 {
29  const algebra::Plane3D &p_;
30  Geometries gdata_;
31  mutable Geometries filtered_;
32  bool handle_sphere(SphereGeometry *g,
33  Color color, std::string name);
34  bool handle_cylinder(CylinderGeometry *g,
35  Color color, std::string name);
36  bool handle_point(PointGeometry *g,
37  Color color, std::string name);
38  bool handle_segment(SegmentGeometry *g,
39  Color color, std::string name);
40 public:
41  //! Pay attention to the orientation of the plane.
43 
44  void add_geometry(Geometry* g);
45 
46  void add_geometry(const Geometries& g);
47 
49 };
50 
51 
52 IMPDISPLAY_END_NAMESPACE
53 
54 #endif /* IMPDISPLAY_FILTER_GEOMETRY_H */