IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
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-2022 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"
14
15IMPDISPLAY_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 */
22class IMPDISPLAYEXPORT GeometryProcessor {
23 protected:
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
64typedef Vector<GeometryProcessor> GeometryProcessors;
65#endif
66IMPDISPLAY_END_NAMESPACE
67
68#endif /* IMPDISPLAY_GEOMETRY_PROCESSOR_H */
A more IMP-like version of the std::vector.
Definition Vector.h:60
Represent an RGB color.
Definition Color.h:25
Provide a standard geometry processing framework.
The base class for geometry.
A text label for a ball in space.
Implement geometry for the basic shapes from IMP.algebra.
Implement geometry for the basic shapes from IMP.algebra.