home
about
news
download
doc
source
systems
tests
bugs
contact
IMP Reference Guide
2.22.0
The Integrative Modeling Platform
IMP Manual
Reference Guide
Tutorial Index
Modules
Classes
Examples
include
IMP
display
version 2.22.0
particle_geometry.h
Go to the documentation of this file.
1
/**
2
* \file IMP/display/particle_geometry.h
3
* \brief Represent an XYZR particle with a sphere
4
*
5
* Copyright 2007-2022 IMP Inventors. All rights reserved.
6
*/
7
8
#ifndef IMPDISPLAY_PARTICLE_GEOMETRY_H
9
#define IMPDISPLAY_PARTICLE_GEOMETRY_H
10
11
#include <IMP/display/display_config.h>
12
#include "
geometry_macros.h
"
13
#include "
declare_Geometry.h
"
14
#include "
Colored.h
"
15
#include <
IMP/Pointer.h
>
16
#include <
IMP/SingletonContainer.h
>
17
#include <
IMP/PairContainer.h
>
18
#include <
IMP/SingletonScore.h
>
19
20
IMPDISPLAY_BEGIN_NAMESPACE
21
22
//! A base class for geometry contained in particles
23
/** */
24
class
IMPDISPLAYEXPORT
SingletonGeometry
:
public
Geometry
{
25
IMP::Pointer<Particle>
p_;
26
27
public
:
28
SingletonGeometry
(
Particle
*p);
29
30
bool
get_has_color()
const override
{
31
return
Geometry::get_has_color() || Colored::get_is_setup(p_);
32
}
33
34
Color
get_color()
const override
{
35
if
(Geometry::get_has_color()) {
36
return
Geometry::get_color();
37
}
else
{
38
return
Colored
(p_).get_color();
39
}
40
}
41
42
Particle
*get_particle()
const
{
return
p_; }
43
44
virtual
~
SingletonGeometry
() {}
45
};
46
47
//! A base class for geometry from a set of particles
48
/**
49
*/
50
class
IMPDISPLAYEXPORT
SingletonsGeometry
:
public
Geometry
{
51
IMP::PointerMember<SingletonContainer>
sc_;
52
53
public
:
54
SingletonsGeometry
(
SingletonContainerAdaptor
pc,
Color
c);
55
SingletonsGeometry
(
SingletonContainerAdaptor
pc);
56
57
SingletonContainer
*get_container()
const
{
return
sc_; }
58
59
virtual
~
SingletonsGeometry
() {}
60
};
61
62
//! A base class for geometry contained in particles
63
/** */
64
class
IMPDISPLAYEXPORT
PairGeometry
:
public
Geometry
{
65
IMP::Pointer<Particle>
p0_, p1_;
66
67
public
:
68
PairGeometry
(
const
ParticlePair
&pp);
69
70
bool
get_has_color()
const override
{
71
return
Geometry::get_has_color() || Colored::get_is_setup(p0_) ||
72
Colored::get_is_setup(p1_);
73
}
74
75
Color
get_color()
const override
{
76
if
(Geometry::get_has_color()) {
77
return
Geometry::get_color();
78
}
else
if
(Colored::get_is_setup(p0_))
79
return
Colored
(p0_).get_color();
80
else
81
return
Colored
(p1_).get_color();
82
}
83
84
ParticlePair
get_particle_pair()
const
{
85
return
ParticlePair
(p0_, p1_);
86
}
87
88
virtual
~
PairGeometry
() {}
89
};
90
91
//! A base class for geometry from a set of particles
92
/**
93
*/
94
class
IMPDISPLAYEXPORT
PairsGeometry
:
public
Geometry
{
95
IMP::PointerMember<PairContainer>
sc_;
96
97
public
:
98
PairsGeometry
(
PairContainer
*pc,
Color
c);
99
PairsGeometry
(
PairContainer
*pc);
100
101
PairContainer
*get_container()
const
{
return
sc_; }
102
103
virtual
~
PairsGeometry
() {}
104
};
105
106
IMPDISPLAY_END_NAMESPACE
107
108
#endif
/* IMPDISPLAY_PARTICLE_GEOMETRY_H */
IMP::display::SingletonGeometry
A base class for geometry contained in particles.
Definition:
particle_geometry.h:24
IMP::PairContainer
A shared container for Pairs.
Definition:
PairContainer.h:39
IMP::display::Color
Represent an RGB color.
Definition:
Color.h:25
Colored.h
A decorator for a particle with a color.
SingletonContainer.h
A container for Singletons.
IMP::display::Geometry
The base class for geometry.
Definition:
declare_Geometry.h:26
IMP::display::PairGeometry
A base class for geometry contained in particles.
Definition:
particle_geometry.h:64
IMP::Array
A class to store a fixed array of same-typed values.
Definition:
Array.h:40
IMP::display::SingletonsGeometry
A base class for geometry from a set of particles.
Definition:
particle_geometry.h:50
geometry_macros.h
macros for display classes
declare_Geometry.h
Implement geometry for the basic shapes from IMP.algebra.
IMP::display::PairsGeometry
A base class for geometry from a set of particles.
Definition:
particle_geometry.h:94
IMP::Pointer
A smart pointer to a reference counted object.
Definition:
Pointer.h:87
PairContainer.h
A container for Pairs.
IMP::PointerMember
A smart pointer to a ref-counted Object that is a class member.
Definition:
Pointer.h:143
IMP::SingletonContainer
A shared container for Singletons.
Definition:
SingletonContainer.h:39
SingletonScore.h
Define SingletonScore.
IMP::SingletonContainerAdaptor
Definition:
SingletonContainer.h:172
Pointer.h
A nullptr-initialized pointer to an IMP Object.
IMP::ParticlePair
Array< 2, WeakPointer< Particle >, Particle * > ParticlePair
Definition:
base_types.h:159
IMP::Particle
Class to handle individual particles of a Model object.
Definition:
Particle.h:43
IMP::display::Colored
A particle with a color.
Definition:
Colored.h:23