IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
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>
17#include <IMP/algebra/Plane3D.h>
18#include <IMP/utility_macros.h>
19
20IMPDISPLAY_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 */
26class 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
52IMPDISPLAY_END_NAMESPACE
53
54#endif /* IMPDISPLAY_FILTER_GEOMETRY_H */
Provide a standard geometry processing framework.
A container for Pairs.
Simple 3D plane class.
A container for Singletons.
Represent a plane in 3D.
Definition Plane3D.h:21
Represent an RGB color.
Definition Color.h:25
FilterGeometry(const algebra::Plane3D &p)
Pay attention to the orientation of the plane.
virtual IMP::display::Geometries get_components() const override
Return a set of geometry composing this one.
Provide a standard geometry processing framework.
Implement geometry for the basic shapes from IMP.algebra.
IMP::Vector< IMP::Pointer< Geometry > > Geometries
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Various general useful macros for IMP.