IMP logo
IMP Reference Guide  develop.63b38c487d,2024/12/21
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-2022 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,
32  std::string name) override;
33  bool handle_cylinder(CylinderGeometry *g, Color color,
34  std::string name) override;
35  bool handle_point(PointGeometry *g, Color color,
36  std::string name) override;
37  bool handle_segment(SegmentGeometry *g, Color color,
38  std::string name) override;
39 
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 
48  virtual IMP::display::Geometries get_components() const override;
50 };
51 
52 IMPDISPLAY_END_NAMESPACE
53 
54 #endif /* IMPDISPLAY_FILTER_GEOMETRY_H */
Represent an RGB color.
Definition: Color.h:25
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:21
Remove geometry which is not above a plane.