[cig-commits] commit:
Mercurial
hg at geodynamics.org
Mon Nov 24 11:59:18 PST 2008
changeset: 118:e87bc137c162
user: JulianGiordani
date: Mon Jul 21 04:30:25 2008 +0000
files: Shape/src/Cylinder.c Shape/src/Cylinder.meta Shape/src/ShapeClass.meta Shape/tests/testCylinder.xml
description:
Changed an input parameter for the cylinder class from "perpendicularAxis" to "alongAxis"
diff -r 903a2446e7fa -r e87bc137c162 Shape/src/Cylinder.c
--- a/Shape/src/Cylinder.c Tue Jul 15 01:15:24 2008 +0000
+++ b/Shape/src/Cylinder.c Mon Jul 21 04:30:25 2008 +0000
@@ -57,7 +57,7 @@ Cylinder* Cylinder_New(
double radius,
XYZ start,
XYZ end,
- Axis perpendicularAxis )
+ Axis alongAxis )
{
Cylinder* self = (Cylinder*) _Cylinder_DefaultNew( name );
@@ -71,7 +71,7 @@ Cylinder* Cylinder_New(
radius,
start,
end,
- perpendicularAxis ) ;
+ alongAxis ) ;
return self;
}
@@ -120,10 +120,10 @@ Cylinder* _Cylinder_New(
return self;
}
-void _Cylinder_Init( Cylinder* self, double radius, XYZ start, XYZ end, Axis perpendicularAxis ) {
+void _Cylinder_Init( Cylinder* self, double radius, XYZ start, XYZ end, Axis alongAxis ) {
memcpy( self->start, start, sizeof(XYZ));
memcpy( self->end, end, sizeof(XYZ));
- self->perpendicularAxis = perpendicularAxis;
+ self->alongAxis = alongAxis;
self->radius = radius;
}
@@ -138,12 +138,12 @@ void Cylinder_InitAll(
double radius,
XYZ start,
XYZ end,
- Axis perpendicularAxis )
+ Axis alongAxis )
{
Cylinder* self = (Cylinder*)cylinder;
Stg_Shape_InitAll( self, dim, centre, alpha, beta, gamma );
- _Cylinder_Init( self, radius, start, end, perpendicularAxis );
+ _Cylinder_Init( self, radius, start, end, alongAxis );
}
@@ -178,7 +178,7 @@ void* _Cylinder_Copy( void* cylinder, vo
memcpy( newCylinder->end, self->end, sizeof(XYZ));
newCylinder->radius = self->radius;
- newCylinder->perpendicularAxis = self->perpendicularAxis;
+ newCylinder->alongAxis = self->alongAxis;
return (void*)newCylinder;
}
@@ -209,7 +209,7 @@ void _Cylinder_Construct( void* cylinder
XYZ start = { -BIG, -BIG, -BIG };
XYZ end = { BIG, BIG, BIG };
double radius = 0.0;
- Axis perpendicularAxis = I_AXIS;
+ Axis alongAxis = I_AXIS;
char* perpendicularAxisName = NULL;
_Stg_Shape_Construct( self, cf, data );
@@ -223,20 +223,20 @@ void _Cylinder_Construct( void* cylinder
end[ J_AXIS ] = Stg_ComponentFactory_GetDouble( cf, self->name, "endY", BIG );
end[ K_AXIS ] = Stg_ComponentFactory_GetDouble( cf, self->name, "endZ", BIG );
- perpendicularAxisName = Stg_ComponentFactory_GetString( cf, self->name, "perpendicularAxis", "x" );
+ perpendicularAxisName = Stg_ComponentFactory_GetString( cf, self->name, "alongAxis", "x" );
switch ( perpendicularAxisName[0] ) {
case 'x': case 'X': case 'i': case 'I': case '0':
- perpendicularAxis = I_AXIS; break;
+ alongAxis = I_AXIS; break;
case 'y': case 'Y': case 'j': case 'J': case '1':
- perpendicularAxis = J_AXIS; break;
+ alongAxis = J_AXIS; break;
case 'z': case 'Z': case 'k': case 'K': case '2':
- perpendicularAxis = K_AXIS; break;
+ alongAxis = K_AXIS; break;
default:
Journal_Firewall( False, Journal_Register( Error_Type, self->type ),
- "Cannot understand perpendicularAxis '%s'\n", perpendicularAxisName );
+ "Cannot understand alongAxis '%s'\n", perpendicularAxisName );
}
- _Cylinder_Init( self, radius, start, end, perpendicularAxis );
+ _Cylinder_Init( self, radius, start, end, alongAxis );
}
void _Cylinder_Build( void* cylinder, void* data ) {
@@ -284,7 +284,7 @@ Bool _Cylinder_IsCoordInside( void* cyli
/* Transform coordinate into canonical reference frame */
Stg_Shape_TransformCoord( self, coord, newCoord );
- newCoord[ self->perpendicularAxis ] = 0.0;
+ newCoord[ self->alongAxis ] = 0.0;
/* Check if coord is within radius */
x = newCoord[ I_AXIS ];
@@ -309,7 +309,7 @@ void _Cylinder_DistanceFromCenterAxis( v
/* Transform coordinate into canonical reference frame */
Stg_Shape_TransformCoord( self, coord, newCoord );
- newCoord[ self->perpendicularAxis ] = 0.0;
+ newCoord[ self->alongAxis ] = 0.0;
/* Check if coord is within radius */
disVec[0] = newCoord[ I_AXIS ];
diff -r 903a2446e7fa -r e87bc137c162 Shape/src/Cylinder.meta
--- a/Shape/src/Cylinder.meta Tue Jul 15 01:15:24 2008 +0000
+++ b/Shape/src/Cylinder.meta Mon Jul 21 04:30:25 2008 +0000
@@ -62,10 +62,10 @@
<param name="Description">z-coord the cylinder ends at</param>
</struct>
<struct>
- <param name="Name">perpendicularAxis</param>
+ <param name="Name">alongAxis</param>
<param name="Type">String</param>
<param name="Default">x</param>
- <param name="Description">axis the cylinder is perpdenicular to</param>
+ <param name="Description">axis the cylinder is aligned with</param>
</struct>
</list>
diff -r 903a2446e7fa -r e87bc137c162 Shape/src/ShapeClass.meta
--- a/Shape/src/ShapeClass.meta Tue Jul 15 01:15:24 2008 +0000
+++ b/Shape/src/ShapeClass.meta Mon Jul 21 04:30:25 2008 +0000
@@ -20,34 +20,28 @@
<list name="Params">
<struct>
- <param name="Name">dim</param>
- <param name="Type">UnsignedInt</param>
- <param name="Default">0</param>
- <param name="Description">...</param>
- </struct>
- <struct>
<param name="Name">CentreX</param>
<param name="Type">Double</param>
<param name="Default">0.0</param>
- <param name="Description">...</param>
+ <param name="Description">x coord the shape is centred on</param>
</struct>
<struct>
<param name="Name">CentreY</param>
<param name="Type">Double</param>
<param name="Default">0.0</param>
- <param name="Description">...</param>
+ <param name="Description">y coord the shape is centred on</param>
</struct>
<struct>
<param name="Name">CentreZ</param>
<param name="Type">Double</param>
<param name="Default">0.0</param>
- <param name="Description">...</param>
+ <param name="Description">z coord the shape is centred on</param>
</struct>
<struct>
<param name="Name">alpha</param>
<param name="Type">Double</param>
<param name="Default">0.0</param>
- <param name="Description">...</param>
+ <param name="Description">Sets the rotatio</param>
</struct>
<struct>
<param name="Name">beta</param>
diff -r 903a2446e7fa -r e87bc137c162 Shape/tests/testCylinder.xml
--- a/Shape/tests/testCylinder.xml Tue Jul 15 01:15:24 2008 +0000
+++ b/Shape/tests/testCylinder.xml Mon Jul 21 04:30:25 2008 +0000
@@ -8,7 +8,7 @@
<struct name="shape">
<param name="Type">Cylinder</param>
<param name="radius">0.3</param>
- <param name="perpendicularAxis">j</param>
+ <param name="alongAxis">j</param>
<param name="startY">0.0</param>
<param name="startX">0.0</param>
<param name="endZ">0.0</param>
More information about the CIG-COMMITS
mailing list