IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
declare_Geometry.h
Go to the documentation of this file.
1/**
2 * \file IMP/display/declare_Geometry.h
3 * \brief Implement geometry for the basic shapes from IMP.algebra.
4 *
5 * Copyright 2007-2022 IMP Inventors. All rights reserved.
6 */
7
8#ifndef IMPDISPLAY_DECLARE_GEOMETRY_H
9#define IMPDISPLAY_DECLARE_GEOMETRY_H
10
11#include <IMP/display/display_config.h>
12#include "Color.h"
13#include <IMP/Object.h>
14#include <IMP/object_macros.h>
16
17IMPDISPLAY_BEGIN_NAMESPACE
18class Geometry;
20
21//! The base class for geometry.
22/** This class doesn't have much to say other than the color.
23
24 \headerfile geometry.h "IMP/display/geometry.h"
25 */
26class IMPDISPLAYEXPORT Geometry : public IMP::Object {
27 bool has_color_;
28 Color color_;
29
30 public:
31 // Geometry();
32 Geometry(std::string name);
33 Geometry(Color c, std::string name);
34 // Geometry(Color c);
35 virtual Color get_color() const {
36 IMP_USAGE_CHECK(has_color_, "Color not set");
37 return color_;
38 }
39
40 virtual bool get_has_color() const { return has_color_; }
41 void set_has_color(bool tf) { has_color_ = tf; }
42 void set_color(Color c) {
43 has_color_ = true;
44 color_ = c;
45 }
46
47 //! Return a set of geometry composing this one
48 virtual Geometries get_components() const { return Geometries(); }
49
51};
52
53IMPDISPLAY_END_NAMESPACE
54
55#endif /* IMPDISPLAY_DECLARE_GEOMETRY_H */
Represent a color.
A shared base class to help in debugging and things.
#define IMP_USAGE_CHECK(expr, message)
A runtime test for incorrect usage of a class or method.
Common base class for heavy weight IMP objects.
Definition Object.h:111
Represent an RGB color.
Definition Color.h:25
The base class for geometry.
virtual Geometries get_components() const
Return a set of geometry composing this one.
IMP::Vector< IMP::Pointer< Geometry > > Geometries
Helper macros for implementing IMP Objects.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
Macros to help with reference counting.
#define IMP_REF_COUNTED_DESTRUCTOR(Name)
Set up destructor for a ref counted object.