8 #ifndef IMPCORE_SURFACE_H
9 #define IMPCORE_SURFACE_H
11 #include <IMP/core/core_config.h>
28 IMPCORE_BEGIN_NAMESPACE
57 static FloatKey get_normal_key(
unsigned int i);
61 return get_particle()->get_derivative(get_normal_key(i));
69 get_particle()->add_to_derivative(get_normal_key(i), v, d);
77 bool get_normal_is_optimized()
const;
80 void set_normal_is_optimized(
bool tf)
const;
89 void reflect() { set_normal(-get_normal()); }
176 double thick=0.1)
const;
185 virtual const Surface get_geometry()
const {
return s_; }
192 const Surface s, std::string name = std::string(
"SurfaceGeometry%1%")) {
218 g_->set_geometry(get_surface());
237 const Surface s, std::string name=
"SurfaceGeometry%1%") {
240 s.
get_model()->add_score_state(c.release());
270 ps.push_back(get_model()->get_particle(dpi_));
271 ps.push_back(get_model()->get_particle(spi_));
283 IMPCORE_END_NAMESPACE
The base class for decorators.
#define IMP_DECORATOR_GET_SET(name, AttributeKey, Type, ReturnType)
Define methods for getting and setting a particular simple field.
double get_height(const Surface &s, const XYZR &d)
Get height of sphere above surface.
ParticleIndex get_particle_index() const
Returns the particle index decorated by this decorator.
double get_height(const algebra::Vector3D &v) const
Get height of point above surface.
double get_depth(const Surface &s, const XYZ &d)
Get depth of point below surface.
Float get_normal_derivative(int i) const
Get the vector of derivatives added to the surface normal.
Represent a cylinder in 3D.
The base class for geometry.
virtual ModelObjectsTemp do_get_outputs() const
#define IMP_DECORATOR_SETUP_1(Name, FirstArgumentType, first_argument_name)
#define IMP_OBJECT_METHODS(Name)
Define the basic things needed by any Object.
Constrain a SurfaceGeometry to a Surface.
Model * get_model() const
Returns the Model containing the particle.
virtual void do_after_evaluate(DerivativeAccumulator *)
Do any necessary updates after the model score is calculated.
Storage of a model, its restraints, constraints and particles.
algebra::Plane3D get_plane() const
Get a plane that lies along the surface.
Display a Surface particle as a cylindrical disk.
Represent a cylinder in 3D.
Constrain the center of a Surface for visualization.
void add_to_normal_derivative(int i, Float v, DerivativeAccumulator &d)
Add v to the derivative of the ith coordinate of the normal.
double get_depth(const algebra::Vector3D &v) const
Get depth of point below surface.
virtual void do_after_evaluate(DerivativeAccumulator *)
Do any necessary updates after the model score is calculated.
Simple implementation of segments in 3D.
#define IMP_NEW(Typename, varname, args)
Declare a ref counted pointer to a new object.
Implement a constraint on the Model.
Class for storing model, its restraints, constraints, and particles.
Implement geometry for the basic shapes from IMP.algebra.
virtual ModelObjectsTemp do_get_outputs() const
void set_coordinates(const algebra::Vector3D &v)
set all coordinates from a vector
void set_reference_frame(const algebra::ReferenceFrame3D &rf)
Set coordinates and normal from a reference frame.
double get_height(const Surface &s, const XYZ &d)
Get height of point above surface.
virtual void do_before_evaluate()
Update the state given the current state of the model.
SurfaceGeometry * create_geometry(const Surface s, std::string name=std::string("SurfaceGeometry%1%"))
Create a geometry from a Surface.
Helper macros for implementing Decorators.
A smart pointer to a ref-counted Object that is a class member.
#define IMP_DECORATOR_SETUP_2(Name, FirstArgumentType, first_argument_name,SecondArgumentType, second_argument_name)
A decorator for a particle with x,y,z coordinates.
#define IMP_DECORATOR_SETUP_0(Name)
const algebra::Vector3D & get_coordinates() const
Convert it to a vector.
A base class for constraints.
A decorator for a particle that represents a surface, its coordinates, and orientation.
Particle * get_particle() const
Returns the particle decorated by this decorator.
virtual ModelObjectsTemp do_get_inputs() const
Classes to handle individual model particles. (Note that implementation of inline functions is in int...
double get_distance_to(const algebra::Vector3D &v) const
Get distance from point to surface.
Simple implementation of segments in 3D.
#define IMP_OBJECTS(Name, PluralName)
Define the types for storing lists of object pointers.
A nullptr-initialized pointer to an IMP Object.
SurfaceGeometry * get_constrained_surface_geometry(const Surface s, std::string name="SurfaceGeometry%1%")
Get surface geometry constrained to the surface.
virtual Geometries get_components() const
Return a set of geometry composing this one.
A shared base class to help in debugging and things.
virtual ModelObjectsTemp do_get_inputs() const
#define IMP_DECORATOR_METHODS(Name, Parent)
double Float
Basic floating-point value (could be float, double...)
void reflect()
Flip surface so normal is reversed.
double get_depth(const Surface &s, const XYZR &d)
Get depth of sphere below surface.
#define IMP_DECORATORS(Name, PluralName, Parent)
Define the types for storing sets of decorators.
Vector3D get_projected(const Vector3D &p) const
Project the point onto the plane.
virtual void do_before_evaluate()
Update the state given the current state of the model.
double get_distance(const Surface &s, const XYZ &d)
Get distance from point to surface.
Vector3D get_global_coordinates(const Vector3D &v) const
Decorator for a sphere-like particle.
DensityMap * get_segment(DensityMap *map_to_segment, int nx_start, int nx_end, int ny_start, int ny_end, int nz_start, int nz_end)
Get a segment of the map according to xyz indexes.
#define IMP_OVERRIDE
Cause a compile error if this method does not override a parent method.
Class for adding derivatives from restraints to the model.
A decorator for a particle with x,y,z coordinates and a radius.