28#ifndef _math_isosurf_shape_h
29#define _math_isosurf_shape_h
37#include <math/isosurf/volume.h>
38#include <math/scmat/matrix.h>
39#include <math/scmat/vector3.h>
48class Shape:
public Volume {
52 virtual double distance_to_surface(
const SCVector3&r,
54 virtual int is_outside(
const SCVector3&r)
const;
67class SphereShape:
public Shape {
74 SphereShape(
const SphereShape&);
76 void boundingbox(
double minvalue,
double maxvalue,
78 double radius()
const {
return _radius; }
79 const SCVector3& origin()
const {
return _origin; }
84 double radius(
double r);
87 int gradient_implemented()
const;
91SphereShape::radius(
double r)
97inline const SCVector3&
98SphereShape::origin(
const SCVector3& o)
105class UncappedTorusHoleShape:
public Shape
116 static UncappedTorusHoleShape*
117 newUncappedTorusHoleShape(
double r,
120 inline ~UncappedTorusHoleShape() {};
121 inline const SphereShape& sphere(
int i)
const {
return (i?_s2:_s1); };
124 inline double radius()
const {
return _r; };
126 void boundingbox(
double valuemin,
double valuemax,
129 int gradient_implemented()
const;
132class NonreentrantUncappedTorusHoleShape:
public UncappedTorusHoleShape
139 NonreentrantUncappedTorusHoleShape(
double r,
142 ~NonreentrantUncappedTorusHoleShape();
145 int gradient_implemented()
const;
148class ReentrantUncappedTorusHoleShape:
public UncappedTorusHoleShape
156 ReentrantUncappedTorusHoleShape(
double r,
159 ~ReentrantUncappedTorusHoleShape();
163 int gradient_implemented()
const;
166class Uncapped5SphereExclusionShape:
public Shape
169 int _solution_exists;
176 double BDxCDdotAD[2];
178 double CDxADdotBD[2];
180 double ADxBDdotCD[2];
192 double theta_intersect;
202 Uncapped5SphereExclusionShape(
double r,
207 static Uncapped5SphereExclusionShape*
208 newUncapped5SphereExclusionShape(
double r,
212 inline ~Uncapped5SphereExclusionShape() {};
216 inline double rA()
const {
return _s1.radius(); };
217 inline double rB()
const {
return _s2.radius(); };
218 inline double rC()
const {
return _s3.radius(); };
219 inline double r()
const {
return _r; };
220 inline int solution_exists()
const {
return _solution_exists; };
223 void boundingbox(
double valuemin,
double valuemax,
226 int gradient_implemented()
const;
230class UnionShape:
public Shape {
232 std::set<Ref<Shape> > _shapes;
239 void boundingbox(
double valuemin,
double valuemax,
242 int gradient_implemented()
const;
virtual void obsolete()
Marks all results as being out of date.
static std::ostream & out0()
Return an ostream that writes from node 0.
A template class that maintains references counts.
Definition ref.h:332
int value_implemented() const
Information about the availability of values, gradients, and hessians.
void compute()
Recompute at least the results that have compute true and are not already computed.
void print(std::ostream &o=ExEnv::out0()) const
Print information about the object.
void print(std::ostream &o=ExEnv::out0()) const
Print information about the object.