1 |
mmeineke |
267 |
#include <cstdlib> |
2 |
|
|
#include <cstring> |
3 |
|
|
|
4 |
|
|
#include "BendStamp.hpp" |
5 |
|
|
|
6 |
|
|
BendStamp::BendStamp(){ |
7 |
|
|
|
8 |
|
|
have_mbrs = 0; |
9 |
|
|
have_constraint = 0; |
10 |
mmeineke |
308 |
isGhost = 0; |
11 |
mmeineke |
267 |
|
12 |
|
|
unhandled = NULL; |
13 |
|
|
have_extras = 0; |
14 |
|
|
} |
15 |
|
|
|
16 |
|
|
BendStamp::~BendStamp(){ |
17 |
|
|
|
18 |
|
|
if( unhandled != NULL ) delete unhandled; |
19 |
|
|
} |
20 |
|
|
|
21 |
|
|
void BendStamp::members( int the_a, int the_b, int the_c ){ |
22 |
|
|
|
23 |
|
|
a = the_a; |
24 |
|
|
b = the_b; |
25 |
|
|
c = the_c; |
26 |
|
|
have_mbrs = 1; |
27 |
|
|
} |
28 |
|
|
|
29 |
|
|
void BendStamp::constrain( double the_constraint ){ |
30 |
|
|
|
31 |
|
|
constraint = the_constraint; |
32 |
|
|
have_constraint = 1; |
33 |
|
|
} |
34 |
|
|
|
35 |
|
|
void BendStamp::assignString( char* lhs, char* rhs ){ |
36 |
mmeineke |
308 |
|
37 |
|
|
if |
38 |
|
|
|
39 |
mmeineke |
267 |
if( unhandled == NULL ) unhandled = new LinkedAssign( lhs, rhs ); |
40 |
|
|
else unhandled->add( lhs, rhs ); |
41 |
|
|
have_extras = 1; |
42 |
|
|
} |
43 |
|
|
|
44 |
|
|
void BendStamp::assignDouble( char* lhs, double rhs ){ |
45 |
|
|
|
46 |
|
|
if( unhandled == NULL ) unhandled = new LinkedAssign( lhs, rhs ); |
47 |
|
|
else unhandled->add( lhs, rhs ); |
48 |
|
|
have_extras = 1; |
49 |
|
|
} |
50 |
|
|
|
51 |
|
|
void BendStamp::assignInt( char* lhs, int rhs ){ |
52 |
|
|
|
53 |
|
|
if( unhandled == NULL ) unhandled = new LinkedAssign( lhs, rhs ); |
54 |
|
|
else unhandled->add( lhs, rhs ); |
55 |
|
|
have_extras = 1; |
56 |
|
|
} |
57 |
|
|
|
58 |
|
|
char* BendStamp::checkMe(){ |
59 |
|
|
|
60 |
|
|
if( !have_mbrs ){ |
61 |
|
|
return strdup( "BendStamp error. Bend was not given members." ); |
62 |
|
|
} |
63 |
|
|
|
64 |
|
|
return NULL; |
65 |
|
|
} |