IMP logo
IMP Reference Guide  2.13.0
The Integrative Modeling Platform
FilterGeometry.h
Go to the documentation of this file.
1 /**
2  * \file IMP/display/FilterGeometry.h
3  * \brief Remove geometry which is not above a plane.
4  *
5  * Copyright 2007-2020 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>
18 #include <IMP/utility_macros.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 CompoundGeometry is passed to.
25  */
26 class IMPDISPLAYEXPORT FilterGeometry : public GeometryProcessor,
27  public Geometry {
28  const algebra::Plane3D &p_;
29  Geometries gdata_;
30  mutable Geometries filtered_;
31  bool handle_sphere(SphereGeometry *g, Color color, std::string name);
32  bool handle_cylinder(CylinderGeometry *g, Color color, std::string name);
33  bool handle_point(PointGeometry *g, Color color, std::string name);
34  bool handle_segment(SegmentGeometry *g, Color color, std::string name);
35 
36  public:
37  //! Pay attention to the orientation of the plane.
39 
40  void add_geometry(Geometry *g);
41 
42  void add_geometry(const Geometries &g);
43 
46 };
47 
48 IMPDISPLAY_END_NAMESPACE
49 
50 #endif /* IMPDISPLAY_FILTER_GEOMETRY_H */
Represent an RGB color.
Definition: Color.h:24
A container for Singletons.
The base class for geometry.
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Definition: object_macros.h:25
Implement geometry for the basic shapes from IMP.algebra.
Provide a standard geometry processing framework.
A container for Pairs.
Various general useful macros for IMP.
Simple 3D plane class.
virtual Geometries get_components() const
Return a set of geometry composing this one.
Provide a standard geometry processing framework.
void add_geometry(RMF::FileHandle file, display::Geometry *r)
Add a single geometry to the file.
Represent a plane in 3D.
Definition: Plane3D.h:20
Remove geometry which is not above a plane.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.