MPQC
3.0.0-alpha
edge.h
1
//
2
// edge.h
3
//
4
// Copyright (C) 1996 Limit Point Systems, Inc.
5
//
6
// Author: Curtis Janssen <cljanss@limitpt.com>
7
// Maintainer: LPS
8
//
9
// This file is part of the SC Toolkit.
10
//
11
// The SC Toolkit is free software; you can redistribute it and/or modify
12
// it under the terms of the GNU Library General Public License as published by
13
// the Free Software Foundation; either version 2, or (at your option)
14
// any later version.
15
//
16
// The SC Toolkit is distributed in the hope that it will be useful,
17
// but WITHOUT ANY WARRANTY; without even the implied warranty of
18
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19
// GNU Library General Public License for more details.
20
//
21
// You should have received a copy of the GNU Library General Public License
22
// along with the SC Toolkit; see the file COPYING.LIB. If not, write to
23
// the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
24
//
25
// The U.S. Government is granted a limited license as per AL 91-7.
26
//
27
28
#ifndef _math_isosurf_edge_h
29
#define _math_isosurf_edge_h
30
31
#include <set>
32
33
#include <math/isosurf/vertex.h>
34
35
namespace
sc
{
36
37
class
Edge
:
public
RefCount
{
38
private
:
39
int
_order;
40
Ref<Vertex>
*_vertices;
// nvertices = _order + 1
41
public
:
42
Edge
(
const
Ref<Vertex>
&p1,
43
const
Ref<Vertex>
&p2)
44
{
45
_order = 1;
46
_vertices =
new
Ref<Vertex>
[2];
47
_vertices[0]=p1; _vertices[1]=p2;
48
}
49
Edge
(
const
Ref<Vertex>
&p1,
50
const
Ref<Vertex>
&p2,
51
const
Ref<Vertex>
&p3);
52
Edge
(
const
Ref<Vertex>
&p1,
53
const
Ref<Vertex>
&p2,
54
const
Ref<Vertex>
&p3,
55
const
Ref<Vertex>
&p4);
56
~
Edge
();
57
int
order()
const
{
return
_order; }
58
double
straight_length();
59
// return the endpoints
60
Ref<Vertex>
vertex(
int
i)
const
61
{
62
return
i?_vertices[_order]:_vertices[0];
63
}
64
// returns endpoints or interior vertex 0 <= i <= order
65
Ref<Vertex>
interior_vertex(
int
i)
const
66
{
67
return
_vertices[i];
68
}
69
// add the endpoints to the set
70
void
add_vertices(std::set<
Ref<Vertex>
>&);
71
void
set_order(
int
order,
const
Ref<Volume>
&vol,
double
isovalue);
72
// find the position of a point on the edge
73
int
interpolate(
double
location,
SCVector3
&point,
SCVector3
&norm);
74
// find the true position of a point using the isosurface
75
int
interpolate(
double
location,
SCVector3
&point,
SCVector3
&norm,
76
const
Ref<Volume>
&vol,
double
isovalue);
77
};
78
79
}
80
81
#endif
82
83
// Local Variables:
84
// mode: c++
85
// c-file-style: "CLJ"
86
// End:
sc::Ref
A template class that maintains references counts.
Definition:
ref.h:361
sc::SCVector3
a 3-element version of SCVector
Definition:
vector3.h:43
sc::Edge
Definition:
edge.h:37
sc::RefCount
The base class for all reference counted objects.
Definition:
ref.h:192
sc
Contains all MPQC code up to version 3.
Definition:
mpqcin.h:14
Generated at Sun Jan 26 2020 23:24:00 for
MPQC
3.0.0-alpha using the documentation package
Doxygen
1.8.16.