[cig-commits] commit: Filling out some meta files
Mercurial
hg at geodynamics.org
Mon Nov 24 11:29:40 PST 2008
changeset: 85:66c7976aa0f4
user: rob at hijiki.maths.monash.edu.au
date: Fri Oct 31 18:37:38 2008 +1100
files: DrawingObjects/src/Axis.c DrawingObjects/src/Axis.h DrawingObjects/src/Axis.meta DrawingObjects/src/Contour.meta DrawingObjects/src/FeVariableSurface.meta DrawingObjects/src/HistoricalSwarmTrajectory.meta DrawingObjects/src/ScalarField.meta DrawingObjects/src/ScalarFieldCrossSection.meta DrawingObjects/src/ScalarFieldOnMesh.c DrawingObjects/src/ScalarFieldOnMesh.meta DrawingObjects/src/ScalarFieldOnMeshCrossSection.c DrawingObjects/src/ScalarFieldOnMeshCrossSection.h DrawingObjects/src/ScalarFieldOnMeshCrossSection.meta DrawingObjects/src/TimeStep.meta
description:
Filling out some meta files
Rewritting the ScalarFieldOnMesh Code
diff -r 9dac68cbae64 -r 66c7976aa0f4 DrawingObjects/src/Axis.c
--- a/DrawingObjects/src/Axis.c Fri Oct 17 17:44:02 2008 +1100
+++ b/DrawingObjects/src/Axis.c Fri Oct 31 18:37:38 2008 +1100
@@ -78,14 +78,14 @@ lucAxis* lucAxis_New(
lucAxis* lucAxis_New(
Name name,
Coord origin,
- float scale,
+ float length,
lucColour colourX,
lucColour colourY,
lucColour colourZ)
{
lucAxis* self = (lucAxis*) _lucAxis_DefaultNew( name );
- lucAxis_InitAll( self, origin, scale, colourX, colourY, colourZ);
+ lucAxis_InitAll( self, origin, length, colourX, colourY, colourZ);
return self;
}
@@ -138,13 +138,13 @@ void lucAxis_Init(
void lucAxis_Init(
lucAxis* self,
Coord origin,
- float scale,
+ float length,
lucColour colourX,
lucColour colourY,
lucColour colourZ)
{
- self->scale = scale;
+ self->length = length;
memcpy( self->origin, origin, sizeof(Coord) );
memcpy( &(self->colourX), &colourX, sizeof(lucColour) );
memcpy( &(self->colourY), &colourY, sizeof(lucColour) );
@@ -156,7 +156,7 @@ void lucAxis_InitAll(
void lucAxis_InitAll(
void* axis,
Coord origin,
- float scale,
+ float length,
lucColour colourX,
lucColour colourY,
lucColour colourZ)
@@ -164,7 +164,7 @@ void lucAxis_InitAll(
lucAxis* self = axis;
/* TODO Init parent */
- lucAxis_Init( self, origin, scale, colourX, colourY, colourZ );
+ lucAxis_Init( self, origin, length, colourX, colourY, colourZ );
}
void _lucAxis_Delete( void* drawingObject ) {
@@ -185,7 +185,7 @@ void* _lucAxis_Copy( void* axis, void* d
newAxis = _Stg_Component_Copy( self, dest, deep, nameExt, ptrMap );
- newAxis->scale = self->scale;
+ newAxis->length = self->length;
memcpy( &(newAxis->colourX), &(self->colourX), sizeof(lucColour) );
memcpy( &(newAxis->colourY), &(self->colourY), sizeof(lucColour) );
memcpy( &(newAxis->colourZ), &(self->colourZ), sizeof(lucColour) );
@@ -240,7 +240,7 @@ void _lucAxis_Construct( void* axis, Stg
lucAxis_InitAll( self,
origin,
- Stg_ComponentFactory_GetDouble( cf, self->name, "scale", 1.0),
+ Stg_ComponentFactory_GetDouble( cf, self->name, "length", 0.25 ),
self->colourX,
self->colourY,
self->colourZ);
@@ -257,14 +257,13 @@ void _lucAxis_Setup( void* drawingObject
_lucOpenGLDrawingObject_Setup( self, _context );
}
void _lucAxis_Draw( void* drawingObject, lucWindow* window, lucViewportInfo* viewportInfo, void* _context ) {
- lucAxis* self = (lucAxis*)drawingObject;
- lucViewport* viewport = viewportInfo->viewport;
- DomainContext* context = (DomainContext*) _context;
- Dimension_Index dim = context->dim;
-
- double rodLength = 0.0;
- double arrowLength = 0.0;
-
+ lucAxis* self = (lucAxis*)drawingObject;
+ lucViewport* viewport = viewportInfo->viewport;
+ DomainContext* context = (DomainContext*) _context;
+ Dimension_Index dim = context->dim;
+ double rodLength = 0.0;
+ double arrowHeadLength = 0.0;
+ double textSpacing = 0.0;
/* Initialise OpenGL stuff */
glShadeModel(GL_SMOOTH);
@@ -277,103 +276,103 @@ void _lucAxis_Draw( void* drawingObject,
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
/* The rodlength is the total length of the arrow line.
- By default it is 0.25, but can be scaled */
- rodLength = self->scale*0.25;
+ By default it is 0.25 */
+ rodLength = self->length;
- /* The tip of the arrow hea starts at rofLength. The size of the arrow
- is a fifth of the total length
- ---->
- */
- arrowLength = rodLength/5.0;
+ /* The tip of the arrow hea starts at rodLength.
+ The size of the arrow is a fifth of the total length */
+ arrowHeadLength = rodLength/5.0;
+
+ textSpacing = arrowHeadLength;
- if (dim == 2) {
+ if (dim == 2) {
/* Drawing the X axis, default is the RED color */
- glColor3f(self->colourX.red, self->colourX.green, self->colourX.blue);
+ lucColour_SetOpenGLColour( &self->colourX );
glBegin( GL_LINES );
glVertex2f( self->origin[I_AXIS], self->origin[J_AXIS] );
- glVertex2f( self->origin[I_AXIS] + self->scale*0.25 , self->origin[J_AXIS] );
+ glVertex2f( self->origin[I_AXIS] + rodLength , self->origin[J_AXIS] );
glEnd();
glBegin(GL_TRIANGLES);
- glVertex2f( self->origin[I_AXIS] + self->scale*0.25, self->origin[J_AXIS] );
- glVertex2f( self->origin[I_AXIS] + self->scale*0.25 - arrowLength, self->origin[J_AXIS] -arrowLength/2.0);
- glVertex2f( self->origin[I_AXIS] + self->scale*0.25 - arrowLength, self->origin[J_AXIS] +arrowLength/2.0);
- glEnd();
- glRasterPos2f( self->origin[I_AXIS] + self->scale*0.25 + self->scale*0.05, self->origin[J_AXIS] );
- lucPrintString( "X");
+ glVertex2f( self->origin[I_AXIS] + rodLength, self->origin[J_AXIS] );
+ glVertex2f( self->origin[I_AXIS] + rodLength - arrowHeadLength, self->origin[J_AXIS] - arrowHeadLength/2.0);
+ glVertex2f( self->origin[I_AXIS] + rodLength - arrowHeadLength, self->origin[J_AXIS] + arrowHeadLength/2.0);
+ glEnd();
+ glRasterPos2f( self->origin[I_AXIS] + rodLength + textSpacing, self->origin[J_AXIS] );
+ lucPrintString( "X" );
/* Drawing the Y axis, default is the GREEN color */
- glColor3f(self->colourY.red, self->colourY.green, self->colourY.blue);
+ lucColour_SetOpenGLColour( &self->colourY );
glBegin( GL_LINES );
glVertex2f( self->origin[I_AXIS], self->origin[J_AXIS] );
- glVertex2f( self->origin[I_AXIS], self->origin[J_AXIS] + self->scale*0.25 );
+ glVertex2f( self->origin[I_AXIS], self->origin[J_AXIS] + rodLength );
glEnd();
glBegin(GL_TRIANGLES);
- glVertex2f( self->origin[I_AXIS], self->origin[J_AXIS] + self->scale*0.25 );
- glVertex2f( self->origin[I_AXIS] + arrowLength/2.0, self->origin[J_AXIS] + self->scale*0.25 -arrowLength);
- glVertex2f( self->origin[I_AXIS] - arrowLength/2.0, self->origin[J_AXIS] + self->scale*0.25 -arrowLength);
- glEnd();
- glRasterPos2f( self->origin[I_AXIS], self->origin[J_AXIS]+ self->scale*0.25 + self->scale*0.05 );
- lucPrintString( "Y");
+ glVertex2f( self->origin[I_AXIS], self->origin[J_AXIS] + rodLength );
+ glVertex2f( self->origin[I_AXIS] + arrowHeadLength/2.0, self->origin[J_AXIS] + rodLength - arrowHeadLength);
+ glVertex2f( self->origin[I_AXIS] - arrowHeadLength/2.0, self->origin[J_AXIS] + rodLength - arrowHeadLength);
+ glEnd();
+ glRasterPos2f( self->origin[I_AXIS], self->origin[J_AXIS] + rodLength + textSpacing );
+ lucPrintString( "Y" );
}
else if ( dim == 3 ) {
/* Drawing the X axis, by default using the RED color */
- glColor3f(self->colourX.red, self->colourX.green, self->colourX.blue);
-
- glBegin(GL_TRIANGLES);
- glVertex3f( self->origin[I_AXIS] + self->scale*0.25, self->origin[J_AXIS], self->origin[K_AXIS] );
- glVertex3f( self->origin[I_AXIS] + self->scale*0.25 - arrowLength,
- self->origin[J_AXIS] -arrowLength/2.0, self->origin[K_AXIS] );
- glVertex3f( self->origin[I_AXIS] + self->scale*0.25 - arrowLength,
- self->origin[J_AXIS] +arrowLength/2.0,
+ lucColour_SetOpenGLColour( &self->colourX );
+
+ glBegin(GL_TRIANGLES);
+ glVertex3f( self->origin[I_AXIS] + rodLength, self->origin[J_AXIS], self->origin[K_AXIS] );
+ glVertex3f( self->origin[I_AXIS] + rodLength - arrowHeadLength,
+ self->origin[J_AXIS] - arrowHeadLength/2.0, self->origin[K_AXIS] );
+ glVertex3f( self->origin[I_AXIS] + rodLength - arrowHeadLength,
+ self->origin[J_AXIS] + arrowHeadLength/2.0,
self->origin[K_AXIS] );
glEnd();
glBegin( GL_LINES );
glVertex3f( self->origin[I_AXIS], self->origin[J_AXIS] , self->origin[K_AXIS] );
- glVertex3f( self->origin[I_AXIS] + self->scale*0.25, self->origin[J_AXIS] , self->origin[K_AXIS] );
+ glVertex3f( self->origin[I_AXIS] + rodLength, self->origin[J_AXIS] , self->origin[K_AXIS] );
glEnd();
- glRasterPos3f( self->origin[I_AXIS] + self->scale*0.25 + self->scale*0.05, self->origin[J_AXIS], self->origin[K_AXIS] );
- lucPrintString( "X");
-
- /* Drawing the X axis, by default using the GREEN color */
- glColor3f(self->colourY.red, self->colourY.green, self->colourY.blue);
-
- glBegin(GL_TRIANGLES);
- glVertex3f( self->origin[I_AXIS], self->origin[J_AXIS] + self->scale*0.25, self->origin[K_AXIS] );
- glVertex3f( self->origin[I_AXIS] + arrowLength/2.0, self->origin[J_AXIS] + self->scale*0.25 -arrowLength,
+ glRasterPos3f( self->origin[I_AXIS] + rodLength + textSpacing, self->origin[J_AXIS], self->origin[K_AXIS] );
+ lucPrintString( "X" );
+
+ /* Drawing the Y axis, by default using the GREEN color */
+ lucColour_SetOpenGLColour( &self->colourY );
+
+ glBegin(GL_TRIANGLES);
+ glVertex3f( self->origin[I_AXIS], self->origin[J_AXIS] + rodLength, self->origin[K_AXIS] );
+ glVertex3f( self->origin[I_AXIS] + arrowHeadLength/2.0, self->origin[J_AXIS] + rodLength -arrowHeadLength,
self->origin[K_AXIS] );
- glVertex3f( self->origin[I_AXIS] - arrowLength/2.0, self->origin[J_AXIS] + self->scale*0.25 -arrowLength,
+ glVertex3f( self->origin[I_AXIS] - arrowHeadLength/2.0, self->origin[J_AXIS] + rodLength -arrowHeadLength,
self->origin[K_AXIS] );
glEnd();
glBegin( GL_LINES );
glVertex3f( self->origin[I_AXIS], self->origin[J_AXIS] , self->origin[K_AXIS] );
- glVertex3f( self->origin[I_AXIS], self->origin[J_AXIS] + self->scale*0.25 , self->origin[K_AXIS] );
- glEnd();
-
- glRasterPos3f( self->origin[I_AXIS], self->origin[J_AXIS]+ self->scale*0.25 + self->scale*0.05, self->origin[K_AXIS] );
- lucPrintString( "Y");
-
-
- /* Drawing the X axis, by default using the BLUE color */
- glColor3f(self->colourZ.red, self->colourZ.green, self->colourZ.blue);
- glBegin(GL_TRIANGLES);
- glVertex3f( self->origin[I_AXIS], self->origin[J_AXIS] , self->origin[K_AXIS] + self->scale*0.25 );
- glVertex3f( self->origin[I_AXIS] + arrowLength/2.0, self->origin[J_AXIS] ,
- self->origin[K_AXIS] + self->scale*0.25 - arrowLength );
- glVertex3f( self->origin[I_AXIS] - arrowLength/2.0, self->origin[J_AXIS],
- self->origin[K_AXIS] + self->scale*0.25 -arrowLength );
+ glVertex3f( self->origin[I_AXIS], self->origin[J_AXIS] + rodLength , self->origin[K_AXIS] );
+ glEnd();
+
+ glRasterPos3f( self->origin[I_AXIS], self->origin[J_AXIS]+ rodLength + textSpacing, self->origin[K_AXIS] );
+ lucPrintString( "Y" );
+
+
+ /* Drawing the Z axis, by default using the BLUE color */
+ lucColour_SetOpenGLColour( &self->colourZ );
+ glBegin(GL_TRIANGLES);
+ glVertex3f( self->origin[I_AXIS], self->origin[J_AXIS] , self->origin[K_AXIS] + rodLength );
+ glVertex3f( self->origin[I_AXIS] + arrowHeadLength/2.0, self->origin[J_AXIS] ,
+ self->origin[K_AXIS] + rodLength - arrowHeadLength );
+ glVertex3f( self->origin[I_AXIS] - arrowHeadLength/2.0, self->origin[J_AXIS],
+ self->origin[K_AXIS] + rodLength -arrowHeadLength );
glEnd();
glBegin( GL_LINES );
glVertex3f( self->origin[I_AXIS], self->origin[J_AXIS] , self->origin[K_AXIS] );
- glVertex3f( self->origin[I_AXIS], self->origin[J_AXIS] , self->origin[K_AXIS] + self->scale*0.25 );
+ glVertex3f( self->origin[I_AXIS], self->origin[J_AXIS] , self->origin[K_AXIS] + rodLength );
glEnd();
- glRasterPos3f( self->origin[I_AXIS], self->origin[J_AXIS] , self->origin[K_AXIS] + self->scale*0.25+ self->scale*0.05 );
- lucPrintString("Z");
+ glRasterPos3f( self->origin[I_AXIS], self->origin[J_AXIS] , self->origin[K_AXIS] + rodLength + textSpacing );
+ lucPrintString( "Z" );
}
/* Put back settings */
glEnable(GL_LIGHTING);
@@ -387,9 +386,9 @@ void _lucAxis_CleanUp( void* drawingObje
}
void _lucAxis_BuildDisplayList( void* drawingObject, void* _context ) {
- }
-
-
-
-
-
+}
+
+
+
+
+
diff -r 9dac68cbae64 -r 66c7976aa0f4 DrawingObjects/src/Axis.h
--- a/DrawingObjects/src/Axis.h Fri Oct 17 17:44:02 2008 +1100
+++ b/DrawingObjects/src/Axis.h Fri Oct 31 18:37:38 2008 +1100
@@ -53,7 +53,7 @@
#define __lucAxis \
__lucOpenGLDrawingObject \
Coord origin;\
- float scale;\
+ float length;\
lucColour colourX;\
lucColour colourY;\
lucColour colourZ;
@@ -64,7 +64,7 @@
lucAxis* lucAxis_New(
Name name,
Coord origin,
- float scale,
+ float length,
lucColour colourX,
lucColour colourY,
lucColour colourZ);
@@ -90,7 +90,7 @@
void lucAxis_InitAll(
void* axis,
Coord origin,
- float scale,
+ float length,
lucColour colourX,
lucColour colourY,
lucColour colourZ);
@@ -98,7 +98,7 @@
void _lucAxis_Init(
void* axis,
Coord origin,
- float scale,
+ float length,
lucColour colourX,
lucColour colourY,
lucColour colourZ);
diff -r 9dac68cbae64 -r 66c7976aa0f4 DrawingObjects/src/Axis.meta
--- a/DrawingObjects/src/Axis.meta Fri Oct 17 17:44:02 2008 +1100
+++ b/DrawingObjects/src/Axis.meta Fri Oct 31 18:37:38 2008 +1100
@@ -3,7 +3,7 @@
<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
<param name="Name">lucAxis</param>
-<param name="Author">...</param>
+<param name="Author">Cecile Duboz</param>
<param name="Organisation">MCC</param>
<param name="Project">gLucifer</param>
<param name="Location">./</param>
@@ -11,9 +11,9 @@
<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
<param name="Parent">lucOpenGLDrawingObject</param>
-<param name="Reference">...</param>
+<param name="Reference">N/A</param>
<param name="Summary">...</param>
-<param name="Description">Draws a set of X,Y,Z axis </param>
+<param name="Description">Draws a set of X,Y,Z axes.</param>
<!--Now the interesting stuff-->
@@ -23,43 +23,43 @@
<param name="Name">colourX</param>
<param name="Type">String</param>
<param name="Default">"Red"</param>
- <param name="Description">Sets the colour for the X axis</param>
+ <param name="Description">Sets the colour for the X axis.</param>
</struct>
<struct>
<param name="Name">colourY</param>
<param name="Type">String</param>
<param name="Default">"Green"</param>
- <param name="Description">Sets the colour for the Y axis</param>
+ <param name="Description">Sets the colour for the Y axis.</param>
</struct>
<struct>
<param name="Name">colourZ</param>
<param name="Type">String</param>
<param name="Default">"Blue"</param>
- <param name="Description">Sets the colour for the Z axis</param>
+ <param name="Description">Sets the colour for the Z axis.</param>
</struct>
<struct>
<param name="Name">originX</param>
<param name="Type">Double</param>
- <param name="Default">-0.5</param>
- <param name="Description">Sets the X origin of the axis set</param>
+ <param name="Default">-0.25</param>
+ <param name="Description">Sets the X origin of the axis.</param>
</struct>
<struct>
<param name="Name">originY</param>
<param name="Type">Double</param>
<param name="Default">0.0</param>
- <param name="Description">Sets the Y origin of the axis set</param>
+ <param name="Description">Sets the Y origin of the axis.</param>
</struct>
<struct>
<param name="Name">originZ</param>
<param name="Type">Double</param>
<param name="Default">0.0</param>
- <param name="Description">Sets the Z origin of the axis set</param>
+ <param name="Description">Sets the Z origin of the axis.</param>
</struct>
<struct>
- <param name="Name">scale</param>
+ <param name="Name">length</param>
<param name="Type">Double</param>
- <param name="Default">1.0</param>
- <param name="Description">Scales the length of the x,y,z axis</param>
+ <param name="Default">0.25</param>
+ <param name="Description">Scales the length of the X,Y,Z axes.</param>
</struct>
</list>
@@ -68,5 +68,16 @@
</list>
<!-- Add an exmaple XML if possible -->
-<param name="Example">...</param>
+<param name="Example">
+ <struct name="axes" mergeType="replace">
+ <param name="Type">lucAxis</param>
+ <param name="originX">0.0</param>
+ <param name="scale">2.0</param>
+ </struct>
+ <struct name="axes" mergeType="replace">
+ <param name="Type">lucAxis</param>
+ <param name="originX">-0.1</param>
+ <param name="length">0.5</param>
+ </struct>
+</param>
diff -r 9dac68cbae64 -r 66c7976aa0f4 DrawingObjects/src/Contour.meta
--- a/DrawingObjects/src/Contour.meta Fri Oct 17 17:44:02 2008 +1100
+++ b/DrawingObjects/src/Contour.meta Fri Oct 31 18:37:38 2008 +1100
@@ -3,7 +3,7 @@
<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
<param name="Name">lucContour</param>
-<param name="Author">...</param>
+<param name="Author">Robert Turnbull</param>
<param name="Organisation">MCC</param>
<param name="Project">gLucifer</param>
<param name="Location">./gLucifer/DrawingObjects/src/</param>
@@ -11,13 +11,11 @@
<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
<param name="Parent">lucOpenGLDrawingObject</param>
-<param name="Reference">...</param>
+<param name="Reference">N/A</param>
<param name="Summary">...</param>
<param name="Description">Visualises a scalar field by the use of contour lines at specific intervals. It gets the value of the field on a grid and uses a 2D form of the Marching Cubes algorithm to draw the contours.</param>
<!--Now the interesting stuff-->
-
-
<list name="Params">
<struct>
<param name="Name">resolution</param>
@@ -79,6 +77,15 @@
</struct>
</list>
<!-- Add an exmaple XML if possible -->
-<param name="Example">...</param>
+<param name="Example">
+ <struct name="temperatureContours">
+ <param name="Type">lucContour</param>
+ <param name="FieldVariable">TemperatureField</param>
+ <param name="colour">black</param>
+ <param name="interval">0.1</param>
+ <param name="resolution">20</param>
+ <param name="lineWidth">1</param>
+ </struct>
+</param>
</StGermainData>
diff -r 9dac68cbae64 -r 66c7976aa0f4 DrawingObjects/src/FeVariableSurface.meta
--- a/DrawingObjects/src/FeVariableSurface.meta Fri Oct 17 17:44:02 2008 +1100
+++ b/DrawingObjects/src/FeVariableSurface.meta Fri Oct 31 18:37:38 2008 +1100
@@ -3,7 +3,7 @@
<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
<param name="Name">lucFeVariableSurface</param>
-<param name="Author">...</param>
+<param name="Author">Robert Turnbull</param>
<param name="Organisation">MCC</param>
<param name="Project">gLucifer</param>
<param name="Location">./gLucifer/DrawingObjects/src/</param>
@@ -11,37 +11,35 @@
<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
<param name="Parent">lucOpenGLDrawingObject</param>
-<param name="Reference">...</param>
+<param name="Reference">N/A</param>
<param name="Summary">...</param>
-<param name="Description">...</param>
+<param name="Description">Draws a 3D surface with the height representing the scalar value of a 2D field.</param>
<!--Now the interesting stuff-->
-
-
<list name="Params">
<struct>
<param name="Name">colour</param>
<param name="Type">String</param>
- <param name="Default">"black"</param>
- <param name="Description">...</param>
+ <param name="Default">black</param>
+ <param name="Description">If no colour map is given - the surface is drawn with this colour.</param>
</struct>
<struct>
<param name="Name">wireframe</param>
<param name="Type">Bool</param>
<param name="Default">False</param>
- <param name="Description">...</param>
+ <param name="Description">Whether or not the inside of elements should be coloured.</param>
</struct>
<struct>
<param name="Name">lineWidth</param>
<param name="Type">Double</param>
<param name="Default">1.0</param>
- <param name="Description">...</param>
+ <param name="Description">The width of the lines drawn if the surface is being rendered as a wireframe.</param>
</struct>
<struct>
<param name="Name">scaleHeight</param>
<param name="Type">Double</param>
- <param name="Default">0.0 )</param>
- <param name="Description">...</param>
+ <param name="Default">0.0</param>
+ <param name="Description">The factor which the value of the field is multiplied by to calculate the height of the surface for a node. If left at zero, it will result in the surface being drawn in 2 dimensions.</param>
</struct>
</list>
@@ -51,23 +49,26 @@
<param name="Essential">True</param>
<param name="Name">FeVariable</param>
<param name="Type">FieldVariable</param>
- <param name="Description">...</param>
+ <param name="Description">The scalar field being represented by the surface.</param>
</struct>
-
-<!-- PLEASE, check the above struct information is accurate, in line number 138 of the c file and then remove this comment afterwards -->
-
<struct>
<param name="Essential">No</param>
<param name="Name">ColourMap</param>
<param name="Type">lucColourMap</param>
- <param name="Description">...</param>
+ <param name="Description">The mapping which determines the colour of the surface. It uses the value of the field. It no colour map is given, the colour of the whole surface and be specified with the parameter "colour".</param>
</struct>
-
-<!-- PLEASE, check the above struct information is accurate, in line number 139 of the c file and then remove this comment afterwards -->
-
</list>
<!-- Add an exmaple XML if possible -->
-<param name="Example">...</param>
+<param name="Example">
+ <struct name="temperatureSurface">
+ <param name="Type">lucFeVariableSurface</param>
+ <param name="FeVariable">TemperatureField</param>
+ <param name="ColourMap">temperatureColourMap</param>
+ <param name="scaleHeight">0.5</param>
+ <param name="wireframe">true</param>
+ <param name="lineWidth">1.2</param>
+ </struct>
+</param>
</StGermainData>
diff -r 9dac68cbae64 -r 66c7976aa0f4 DrawingObjects/src/HistoricalSwarmTrajectory.meta
--- a/DrawingObjects/src/HistoricalSwarmTrajectory.meta Fri Oct 17 17:44:02 2008 +1100
+++ b/DrawingObjects/src/HistoricalSwarmTrajectory.meta Fri Oct 31 18:37:38 2008 +1100
@@ -3,7 +3,7 @@
<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
<param name="Name">lucHistoricalSwarmTrajectory</param>
-<param name="Author">...</param>
+<param name="Author">Robert Turnbull</param>
<param name="Organisation">MCC</param>
<param name="Project">gLucifer</param>
<param name="Location">./gLucifer/DrawingObjects/src/</param>
@@ -11,9 +11,9 @@
<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
<param name="Parent">lucOpenGLDrawingObject</param>
-<param name="Reference">...</param>
-<param name="Summary">...</param>
-<param name="Description">...</param>
+<param name="Reference">N/A</param>
+<param name="Summary">See description.</param>
+<param name="Description">Draws a trail for each particle, showing where each one has been.</param>
<!--Now the interesting stuff-->
@@ -23,15 +23,26 @@
<param name="Name">colour</param>
<param name="Type">String</param>
<param name="Default">"black"</param>
- <param name="Description">...</param>
+ <param name="Description">The colour of the line (is overridden by the Colour Map if one is present)</param>
</struct>
<struct>
<param name="Name">lineWidth</param>
<param name="Type">Double</param>
- <param name="Default">1.0 )</param>
- <param name="Description">...</param>
+ <param name="Default">1.0</param>
+ <param name="Description">The thickness of the line.</param>
</struct>
-
+ <struct>
+ <param name="Name">historySteps</param>
+ <param name="Type">Unsigned Int</param>
+ <param name="Default">50</param>
+ <param name="Description">How many timesteps the particle's position is recorded.</param>
+ </struct>
+ <struct>
+ <param name="Name">historyTime</param>
+ <param name="Type">Double</param>
+ <param name="Default">0.0</param>
+ <param name="Description">The maximum time period in the past for which a particle will visualise its trajectory. If this value is left at 0.0 then all the particle's positions up to 'historySteps' will be displayed.</param>
+ </struct>
</list>
<list name="Dependencies">
@@ -39,23 +50,27 @@
<param name="Essential">True</param>
<param name="Name">Swarm</param>
<param name="Type">Swarm</param>
- <param name="Description">...</param>
+ <param name="Description">The swarm containing the particles to be visualised.</param>
</struct>
-
-<!-- PLEASE, check the above struct information is accurate, in line number 135 of the c file and then remove this comment afterwards -->
<struct>
<param name="Essential">No</param>
<param name="Name">ColourMap</param>
<param name="Type">lucColourMap</param>
- <param name="Description">...</param>
+ <param name="Description">The colour map determining how the line changes colour according to how long ago the particle was in that position.</param>
</struct>
-
-<!-- PLEASE, check the above struct information is accurate, in line number 136 of the c file and then remove this comment afterwards -->
-
</list>
<!-- Add an exmaple XML if possible -->
-<param name="Example">...</param>
+<param name="Example">
+ <struct name="swarmTrajectory">
+ <param name="Type">lucHistoricalSwarmTrajectory</param>
+ <param name="Swarm">materialPointSwarm</param>
+ <param name="ColourMap">fadeAwayColourMap</param>
+ <param name="lineWidth">1.2</param>
+ <param name="historySteps">80</param>
+ <param name="historyTime">0.001</param>
+ </struct>
+</param>
</StGermainData>
diff -r 9dac68cbae64 -r 66c7976aa0f4 DrawingObjects/src/ScalarField.meta
--- a/DrawingObjects/src/ScalarField.meta Fri Oct 17 17:44:02 2008 +1100
+++ b/DrawingObjects/src/ScalarField.meta Fri Oct 31 18:37:38 2008 +1100
@@ -3,7 +3,7 @@
<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
<param name="Name">lucScalarField</param>
-<param name="Author">...</param>
+<param name="Author">Robert Turnbull</param>
<param name="Organisation">MCC</param>
<param name="Project">gLucifer</param>
<param name="Location">./gLucifer/DrawingObjects/src/</param>
@@ -11,7 +11,7 @@
<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
<param name="Parent">lucScalarFieldCrossSection</param>
-<param name="Reference">...</param>
+<param name="Reference">N/A</param>
<param name="Summary">...</param>
<param name="Description">Tiles the side walls of the model with colours derived from the value of a scalar field at the vertex of each tile.</param>
@@ -32,6 +32,12 @@
</list>
<!-- Add an exmaple XML if possible -->
-<param name="Example">...</param>
+<param name="Example">
+ <struct name="temperatureMap">
+ <param name="Type">lucScalarField</param>
+ <param name="FieldVariable">TemperatureField</param>
+ <param name="ColourMap">temperatureColourMap</param>
+ </struct>
+</param>
</StGermainData>
diff -r 9dac68cbae64 -r 66c7976aa0f4 DrawingObjects/src/ScalarFieldCrossSection.meta
--- a/DrawingObjects/src/ScalarFieldCrossSection.meta Fri Oct 17 17:44:02 2008 +1100
+++ b/DrawingObjects/src/ScalarFieldCrossSection.meta Fri Oct 31 18:37:38 2008 +1100
@@ -3,7 +3,7 @@
<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
<param name="Name">lucScalarFieldCrossSection</param>
-<param name="Author">...</param>
+<param name="Author">Robert Turnbull</param>
<param name="Organisation">MCC</param>
<param name="Project">gLucifer</param>
<param name="Location">./gLucifer/DrawingObjects/src/</param>
@@ -104,6 +104,17 @@
</list>
<!-- Add an exmaple XML if possible -->
-<param name="Example">...</param>
+<param name="Example">
+ <struct name="crosssection">
+ <param name="Type">lucScalarFieldCrossSection</param>
+ <param name="ColourMap">temperatureColourMap</param>
+ <param name="FieldVariable">TemperatureField</param>
+ <param name="crossSection">z=0.5</param>
+ <param name="resolution">256</param>
+ </struct>
+</param>
+
+
+
</StGermainData>
diff -r 9dac68cbae64 -r 66c7976aa0f4 DrawingObjects/src/ScalarFieldOnMesh.c
--- a/DrawingObjects/src/ScalarFieldOnMesh.c Fri Oct 17 17:44:02 2008 +1100
+++ b/DrawingObjects/src/ScalarFieldOnMesh.c Fri Oct 31 18:37:38 2008 +1100
@@ -47,6 +47,7 @@
#include <mpi.h>
#include <StGermain/StGermain.h>
#include <StgDomain/StgDomain.h>
+#include <StgFEM/StgFEM.h>
#include <glucifer/Base/Base.h>
#include <glucifer/RenderingEngines/RenderingEngines.h>
@@ -66,9 +67,6 @@
#endif
#include <string.h>
-#ifndef MASTER
- #define MASTER 0
-#endif
/* Textual name of this class - This is a global pointer which is used for times when you need to refer to class and not a particular instance of a class */
const Type lucScalarFieldOnMesh_Type = "lucScalarFieldOnMesh";
@@ -214,31 +212,29 @@ void _lucScalarFieldOnMesh_CleanUp( void
}
void _lucScalarFieldOnMesh_BuildDisplayList( void* drawingObject, void* _context ) {
- lucScalarFieldOnMesh* self = (lucScalarFieldOnMesh*)drawingObject;
- DomainContext* context = (DomainContext*) _context;
- FieldVariable* fieldVariable = self->fieldVariable;
- Coord min;
- Coord max;
-
- /* Scale Colour Map */
- FieldVariable_GetMinAndMaxGlobalCoords( fieldVariable, min, max );
-
- if (context->dim == 2) {
- lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, min[ K_AXIS ], K_AXIS );
+ lucScalarFieldOnMesh* self = (lucScalarFieldOnMesh*)drawingObject;
+ FeVariable* fieldVariable = (FeVariable*) self->fieldVariable;
+ Mesh* mesh = (Mesh*) fieldVariable->feMesh;
+ Grid* vertGrid;
+
+ vertGrid = *(Grid**)ExtensionManager_Get( mesh->info, mesh, ExtensionManager_GetHandle( mesh->info, "vertexGrid" ) );
+
+ if (fieldVariable->dim == 2) {
+ lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, 0, K_AXIS );
}
else {
if ( self->cullFace )
glEnable(GL_CULL_FACE);
glFrontFace(GL_CCW);
- lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, min[ I_AXIS ], I_AXIS );
- lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, max[ J_AXIS ], J_AXIS );
- lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, min[ K_AXIS ], K_AXIS );
+ lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, 0, I_AXIS );
+ lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, vertGrid->sizes[ J_AXIS ] - 1, J_AXIS );
+ lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, 0, K_AXIS );
glFrontFace(GL_CW);
- lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, max[ I_AXIS ], I_AXIS );
- lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, min[ J_AXIS ], J_AXIS );
- lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, max[ K_AXIS ], K_AXIS );
+ lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, vertGrid->sizes[ I_AXIS ] - 1, I_AXIS );
+ lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, 0, J_AXIS );
+ lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, vertGrid->sizes[ K_AXIS ] - 1, K_AXIS );
glDisable(GL_CULL_FACE);
}
diff -r 9dac68cbae64 -r 66c7976aa0f4 DrawingObjects/src/ScalarFieldOnMesh.meta
--- a/DrawingObjects/src/ScalarFieldOnMesh.meta Fri Oct 17 17:44:02 2008 +1100
+++ b/DrawingObjects/src/ScalarFieldOnMesh.meta Fri Oct 31 18:37:38 2008 +1100
@@ -3,7 +3,7 @@
<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
<param name="Name">lucScalarFieldOnMesh</param>
-<param name="Author">...</param>
+<param name="Author">Cecile Duboz</param>
<param name="Organisation">MCC</param>
<param name="Project">gLucifer</param>
<param name="Location">./</param>
@@ -11,9 +11,9 @@
<param name="Copyright">Copyright (c) 2005, Monash Cluster Computing</param>
<param name="License">http://www.opensource.org/licenses/bsd-license.php</param>
<param name="Parent">lucScalarFieldOnMeshCrossSection</param>
-<param name="Reference">...</param>
+<param name="Reference">N/A</param>
<param name="Summary">...</param>
-<param name="Description">...</param>
+<param name="Description">Tiles the side walls of the model with colours derived from the value of a scalar field at the vertex of each tile.</param>
<!--Now the interesting stuff-->
@@ -22,8 +22,8 @@
<struct>
<param name="Name">cullFace</param>
<param name="Type">Bool</param>
- <param name="Default">True )</param>
- <param name="Description">...</param>
+ <param name="Default">True</param>
+ <param name="Description">If this is False, all walls of the box will be drawn and you will not be able to see insdie the box. If this is true, only the far walls of the box will be drawn, allowing other things in the box to be visualised. In 2D this feature is ignored.</param>
</struct>
</list>
@@ -31,6 +31,13 @@
<list name="Dependencies">
</list>
+
<!-- Add an exmaple XML if possible -->
-<param name="Example">...</param>
+<param name="Example">
+ <struct name="temperatureMap">
+ <param name="Type">lucScalarFieldOnMesh</param>
+ <param name="FieldVariable">TemperatureField</param>
+ <param name="ColourMap">temperatureColourMap</param>
+ </struct>
+</param>
diff -r 9dac68cbae64 -r 66c7976aa0f4 DrawingObjects/src/ScalarFieldOnMeshCrossSection.c
--- a/DrawingObjects/src/ScalarFieldOnMeshCrossSection.c Fri Oct 17 17:44:02 2008 +1100
+++ b/DrawingObjects/src/ScalarFieldOnMeshCrossSection.c Fri Oct 31 18:37:38 2008 +1100
@@ -120,11 +120,10 @@ lucScalarFieldOnMeshCrossSection* _lucSc
}
void _lucScalarFieldOnMeshCrossSection_Init(
- lucScalarFieldOnMeshCrossSection* self,
+ lucScalarFieldOnMeshCrossSection* self,
Name fieldVariableName,
lucColourMap* colourMap,
- IJK resolution,
- double crossSectionValue,
+ Node_Index crossSection_I,
Axis crossSectionAxis,
XYZ minCropValues,
XYZ maxCropValues )
@@ -132,8 +131,7 @@ void _lucScalarFieldOnMeshCrossSection_I
// self->fieldVariable = fieldVariable;
self->fieldVariableName = fieldVariableName;
self->colourMap = colourMap;
- memcpy( self->resolution, resolution, sizeof(IJK) );
- self->crossSectionValue = crossSectionValue;
+ self->crossSection_I = crossSection_I;
self->crossSectionAxis = crossSectionAxis;
memcpy( self->minCropValues, minCropValues, sizeof(XYZ) );
memcpy( self->maxCropValues, maxCropValues, sizeof(XYZ) );
@@ -188,9 +186,8 @@ void _lucScalarFieldOnMeshCrossSection_C
lucScalarFieldOnMeshCrossSection* self = (lucScalarFieldOnMeshCrossSection*)drawingObject;
lucColourMap* colourMap;
Index defaultResolution;
- IJK resolution;
char axisChar;
- double value = 0.0;
+ Node_Index value = 0;
Axis axis = 0;
Name crossSectionName;
Name fieldVariableName;
@@ -208,13 +205,8 @@ void _lucScalarFieldOnMeshCrossSection_C
colourMap = Stg_ComponentFactory_ConstructByKey( cf, self->name, "ColourMap", lucColourMap, True, data );
- defaultResolution = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolution", 128 );
- resolution[ I_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionX", defaultResolution );
- resolution[ J_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionY", defaultResolution );
- resolution[ K_AXIS ] = Stg_ComponentFactory_GetUnsignedInt( cf, self->name, "resolutionZ", defaultResolution );
-
crossSectionName = Stg_ComponentFactory_GetString( cf, self->name, "crossSection", "" );
- if ( sscanf( crossSectionName, "%c=%lf", &axisChar, &value ) == 2 ) {
+ if ( sscanf( crossSectionName, "%c=%d", &axisChar, &value ) == 2 ) {
if ( toupper( axisChar ) >= 'X' )
axis = toupper( axisChar ) - 'X';
}
@@ -231,7 +223,6 @@ void _lucScalarFieldOnMeshCrossSection_C
self,
fieldVariableName,
colourMap,
- resolution,
value,
axis,
minCropValues,
@@ -244,7 +235,7 @@ void _lucScalarFieldOnMeshCrossSection_B
Stg_ComponentFactory* cf = context->CF;
/* HACK - Get pointer to FieldVariable in build phase just to let FieldVariables be created in plugins */
- self->fieldVariable = Stg_ComponentFactory_ConstructByName( cf, self->fieldVariableName, FieldVariable, True, 0 /* dummy */ );
+ self->fieldVariable = (FieldVariable*) Stg_ComponentFactory_ConstructByName( cf, self->fieldVariableName, FeVariable, True, 0 /* dummy */ );
}
void _lucScalarFieldOnMeshCrossSection_Initialise( void* drawingObject, void* data ) {}
@@ -271,7 +262,7 @@ void _lucScalarFieldOnMeshCrossSection_C
void _lucScalarFieldOnMeshCrossSection_BuildDisplayList( void* drawingObject, void* _context ) {
lucScalarFieldOnMeshCrossSection* self = (lucScalarFieldOnMeshCrossSection*)drawingObject;
- lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, self->crossSectionValue, self->crossSectionAxis );
+ lucScalarFieldOnMeshCrossSection_DrawCrossSection( self, self->crossSection_I, self->crossSectionAxis );
}
#define FUDGE_FACTOR 0.0001
@@ -285,230 +276,71 @@ Bool lucScalarFieldOnMeshCrossSection_Is
return False;
}
-void lucScalarFieldOnMeshCrossSection_DrawCrossSection( void* drawingObject, double crossSectionValue, Axis axis ) {
- lucScalarFieldOnMeshCrossSection* self = (lucScalarFieldOnMeshCrossSection*)drawingObject;
- FieldVariable* fieldVariable = self->fieldVariable;
- Axis aAxis;
- Axis bAxis;
- Coord min;
- Coord max;
- Coord pos;
- Coord interpolationCoord;
- float normal[3];
- Index aResolution;
- Index bResolution;
- Index aIndex;
- Index bIndex;
- double aLength;
- double bLength;
- Dimension_Index dim_I;
-
+void lucScalarFieldOnMeshCrossSection_DrawCrossSection( void* drawingObject, Node_LocalIndex crossSection_I, Axis axis ) {
+ lucScalarFieldOnMeshCrossSection* self = (lucScalarFieldOnMeshCrossSection*)drawingObject;
+ FeVariable* fieldVariable = (FeVariable*) self->fieldVariable;
+ Mesh* mesh = (Mesh*) fieldVariable->feMesh;
+ Axis aAxis;
+ Axis bAxis;
+ Grid* vertGrid;
+ IJK node_ijk;
+ float normal[3];
+ Dimension_Index dim_I;
Node_LocalIndex node_lI;
- Node_Index elNode_I;
- Element_LocalIndex element_lI;
- unsigned nIncVerts, *incVerts;
- IArray *inc;
-
-
+ unsigned nIncVerts, *incVerts;
+ IArray* inc;
+
glDisable(GL_LIGHTING);
+ /* Get Axis Directions */
aAxis = ( axis == I_AXIS ? J_AXIS : I_AXIS );
bAxis = ( axis == K_AXIS ? J_AXIS : K_AXIS );
- aResolution = self->resolution[ aAxis ];
- bResolution = self->resolution[ bAxis ];
+ vertGrid = *(Grid**)ExtensionManager_Get( mesh->info, mesh, ExtensionManager_GetHandle( mesh->info, "vertexGrid" ) );
Journal_DPrintfL( self->debugStream, 2,
- "%s called on field %s, with res[A] as %u, res[B] as %u, axis of cross section as %d, crossSectionValue as %g\n",
- __func__, fieldVariable->name, aResolution, bResolution, axis, crossSectionValue );
-
- FieldVariable_GetMinAndMaxLocalCoords( fieldVariable, min, max );
- /* Crop the size of the cros-section that you wish to draw */
- for ( dim_I = 0 ; dim_I < fieldVariable->dim ; dim_I++ ) {
- min[ dim_I ] = MAX( self->minCropValues[ dim_I ], min[ dim_I ]);
- max[ dim_I ] = MIN( self->maxCropValues[ dim_I ], max[ dim_I ]);
- }
-
+ "%s called on field %s, with axis of cross section as %d, crossSection_I as %d\n",
+ __func__, fieldVariable->name, axis, crossSection_I );
+
/* Create normal */
normal[axis] = 1.0;
normal[aAxis] = 0.0;
normal[bAxis] = 0.0;
glNormal3fv( normal );
- /* Find position of cross - section */
- pos[axis] = crossSectionValue;
-
- aLength = (max[aAxis] - min[aAxis])/(double)aResolution;
- bLength = (max[bAxis] - min[bAxis])/(double)bResolution;
-
- Journal_DPrintfL( self->debugStream, 2, "Calculated aLength as %g, bLength as %g\n", aLength, bLength );
-
- /* Plots element per element from node to node in order to respect the
- geometry of a deforming mesh */
-
- Mesh *mesh = (Mesh*)( ( (FeVariable*)(self->fieldVariable) )->feMesh);
- #ifdef TEST
- /* Get min max of fieldVariable... This is for test purpose */
-
- float minVal = FieldVariable_GetMinGlobalFieldMagnitude( fieldVariable );
- float maxVal = FieldVariable_GetMaxGlobalFieldMagnitude( fieldVariable );
- printf(" minVal is %f maxval is %f\n", minVal, maxVal);
- printf("mesh->nodeLocalCount is %d\n", mesh->nodeLocalCount);
- float ninterval = (maxVal - minVal) / (mesh->nodeLocalCount);
- float myVal = minVal;
-
- double* displayVal = Memory_Alloc(double, mesh->nodeLocalCount, "ScalarField_mesh->nodeLocalCount");
- int i;
- int k;
-
- int minList[15]= {0,5,10,15,20, 2, 7, 12,17,22, 4,9,14,19,24};
- int maxList[10] = {1,6,11,16,21,3,8,13,18,23};
-
-
- for(i = 0; i< mesh->nodeLocalCount; i++){
-
- if( lucScalarFieldOnMeshCrossSection_IsInList(i, minList, 15) ){
- //displayVal[i] = minVal + i*ninterval;
- displayVal[i] = minVal ;
+ /* Plots cross section */
+ node_ijk[ axis ] = crossSection_I;
+ for ( node_ijk[ aAxis ] = 0 ; node_ijk[ aAxis ] < vertGrid->sizes[ aAxis ] - 1 ; node_ijk[ aAxis ]++ ) {
+ glBegin(GL_QUAD_STRIP);
+ for ( node_ijk[ bAxis ] = 0 ; node_ijk[ bAxis ] < vertGrid->sizes[ bAxis ] ; node_ijk[ bAxis ]++ ) {
+ node_lI = Grid_Project( vertGrid, node_ijk );
+ lucScalarFieldOnMeshCrossSection_PlotColouredNode( self, node_lI );
+
+ node_ijk[ aAxis ]++;
+ node_lI = Grid_Project( vertGrid, node_ijk );
+ lucScalarFieldOnMeshCrossSection_PlotColouredNode( self, node_lI );
+ node_ijk[ aAxis ]--;
+
+ /* TODO Cropping */
}
- else{
- displayVal[i] = maxVal;
- }
-
- }
- #endif
-
-
- /* TODO: The elements could have nodes insides...... !!!*/
- #define NORMAL_LUCSCALARFIELD_BEHAVIOUR
- #ifdef NORMAL_LUCSCALARFIELD_BEHAVIOUR
- inc = IArray_New();
- for ( element_lI = 0; element_lI < Mesh_GetLocalSize( mesh, Mesh_GetDimSize( mesh ) ); element_lI++ ) {
- Mesh_GetIncidence( mesh, Mesh_GetDimSize( mesh ), element_lI, MT_VERTEX, inc );
- nIncVerts = IArray_GetSize( inc );
- incVerts = IArray_GetPtr( inc );
-
- /* Normal general case, the element can have whatever number of nodes */
- glBegin(GL_POLYGON);
- for ( elNode_I=0; elNode_I < nIncVerts; elNode_I++ ) {
- node_lI = incVerts[elNode_I];
- //printf("elNode_I is %d node_lI is %d displayVal[node_lI] is %f \n", elNode_I, node_lI, displayVal[node_lI]);
-
- // Should be there when no test
- memcpy( interpolationCoord, mesh->verts[node_lI], sizeof(Coord) );
-
- // Plot the node
- lucScalarFieldOnMeshCrossSection_PlotColouredVertex( self, interpolationCoord, mesh->verts[node_lI]);
-
- #ifdef TEST
- // Plot the node
- // lucScalarFieldOnMeshCrossSection_PlotTestColouredVertex( self, displayVal[node_lI], mesh->nodeCoord[node_lI]);
- #endif
- }
glEnd();
}
- #endif
-
- #ifdef LUC_SCALAR_FIELD_PLOTS_SQUAD_STRIP
- Node_LocalIndex node_0;
- Node_LocalIndex node_1;
- Node_LocalIndex node_2;
- Node_LocalIndex node_3;
-
- /** testing the quad_strip way --- ASSUMES only 4 nodes per element */
- /* checking that there is 4 nodes per element - If yes, the quad strips can be used */
- Mesh_GetIncidence( mesh, Mesh_GetDimSize( mesh ), element_lI, MT_VERTEX, inc );
- nIncVerts = IArray_GetSize( inc );
- incVerts = IArray_GetPtr( inc );
- if( nIncVerts == 4 ){
- glBegin(GL_QUAD_STRIP);
- /* The nodes are for 10, 10 msh for instance instance 0,1,10,9 We want to display 0,9
- and 1,10 for the quads, so display node 0,3,1,2 */
-
- node_0 = incVerts[0];
- node_1 = incVerts[3];
- node_2 = incVerts[1];
- node_3 = incVerts[2];
-
- memcpy( interpolationCoord, mesh->verts[node_0], sizeof(Coord) );
- lucScalarFieldOnMeshCrossSection_PlotColouredVertex( self, interpolationCoord, mesh->verts[node_0]);
-
- memcpy( interpolationCoord, mesh->verts[node_1], sizeof(Coord) );
- lucScalarFieldOnMeshCrossSection_PlotColouredVertex( self, interpolationCoord, mesh->verts[node_1]);
-
- memcpy( interpolationCoord, mesh->verts[node_2], sizeof(Coord) );
- lucScalarFieldOnMeshCrossSection_PlotColouredVertex( self, interpolationCoord, mesh->verts[node_2]);
-
- memcpy( interpolationCoord, mesh->verts[node_3], sizeof(Coord) );
- lucScalarFieldOnMeshCrossSection_PlotColouredVertex( self, interpolationCoord, mesh->verts[node_3]);
-
- glEnd();
- }
- #endif
glEnable(GL_LIGHTING);
-
- NewClass_Delete( inc );
-}
-
-
-
-
-Bool lucScalarFieldOnMeshCrossSection_PlotTestColouredVertex( void* drawingObject, double quantity, Coord plotCoord ) {
- lucScalarFieldOnMeshCrossSection* self = (lucScalarFieldOnMeshCrossSection*)drawingObject;
- FieldVariable* fieldVariable = self->fieldVariable;
- lucColourMap* cmap = self->colourMap;
-
-
-// if ( LOCAL == FieldVariable_InterpolateValueAt( fieldVariable, interpolationCoord, &quantity )) {
- /* Get colour for this value from colour map */
- //printf("quantity is : %f\n ", quantity);
-
- lucColourMap_SetOpenGLColourFromValue( cmap, quantity );
-
- // Journal_DPrintfL( self->debugStream, 3, "%s is %g there.\n", fieldVariable->name, quantity );
-
- // Journal_DPrintfL( self->debugStream, 3, "Plotting At Vertex (%g,%g,%g).\n",
- // plotCoord[0], plotCoord[1], plotCoord[2] );
-
- /* Plot Vertex */
- glVertex3dv(plotCoord);
-
- return True;
-// }
-
- Journal_DPrintfL( self->debugStream, 3, "%s NOT FOUND THERE.\n", fieldVariable->name );
- /* If value could not be interpolated return warning */
- return False;
-}
-
-
-Bool lucScalarFieldOnMeshCrossSection_PlotColouredVertex( void* drawingObject, Coord interpolationCoord, Coord plotCoord ) {
- lucScalarFieldOnMeshCrossSection* self = (lucScalarFieldOnMeshCrossSection*)drawingObject;
- FieldVariable* fieldVariable = self->fieldVariable;
+}
+
+void lucScalarFieldOnMeshCrossSection_PlotColouredNode( void* drawingObject, Node_LocalIndex lNode_I ) {
+ lucScalarFieldOnMeshCrossSection* self = (lucScalarFieldOnMeshCrossSection*)drawingObject;
+ FeVariable* fieldVariable = (FeVariable*) self->fieldVariable;
lucColourMap* cmap = self->colourMap;
double quantity;
- Journal_DPrintfL( self->debugStream, 3, "%s called at interpolationCoord (%g,%g,%g) - ",
- __func__, interpolationCoord[0], interpolationCoord[1], interpolationCoord[2] );
-
-
- /* Interpolate value to this position */
- if ( LOCAL == FieldVariable_InterpolateValueAt( fieldVariable, interpolationCoord, &quantity )) {
- /* Get colour for this value from colour map */
- lucColourMap_SetOpenGLColourFromValue( cmap, quantity );
-
- Journal_DPrintfL( self->debugStream, 3, "%s is %g there.\n", fieldVariable->name, quantity );
-
- Journal_DPrintfL( self->debugStream, 3, "Plotting At Vertex (%g,%g,%g).\n",
- plotCoord[0], plotCoord[1], plotCoord[2] );
-
- /* Plot Vertex */
- glVertex3dv(plotCoord);
-
- return True;
- }
-
- Journal_DPrintfL( self->debugStream, 3, "%s NOT FOUND THERE.\n", fieldVariable->name );
- /* If value could not be interpolated return warning */
- return False;
-}
+ /* Get colour for vertex */
+ FeVariable_GetValueAtNode( fieldVariable, lNode_I, &quantity );
+ lucColourMap_SetOpenGLColourFromValue( cmap, quantity );
+
+ /* Plot vertex */
+ if ( fieldVariable->dim == 2 )
+ glVertex2dv( fieldVariable->feMesh->verts[lNode_I] );
+ else
+ glVertex3dv( fieldVariable->feMesh->verts[lNode_I] );
+}
diff -r 9dac68cbae64 -r 66c7976aa0f4 DrawingObjects/src/ScalarFieldOnMeshCrossSection.h
--- a/DrawingObjects/src/ScalarFieldOnMeshCrossSection.h Fri Oct 17 17:44:02 2008 +1100
+++ b/DrawingObjects/src/ScalarFieldOnMeshCrossSection.h Fri Oct 31 18:37:38 2008 +1100
@@ -59,8 +59,7 @@
FieldVariable* fieldVariable; \
Name fieldVariableName; \
lucColourMap* colourMap; \
- IJK resolution; \
- double crossSectionValue; \
+ Node_Index crossSection_I; \
Axis crossSectionAxis; \
XYZ minCropValues; \
XYZ maxCropValues; \
@@ -104,7 +103,9 @@
void _lucScalarFieldOnMeshCrossSection_BuildDisplayList( void* drawingObject, void* _context ) ;
- void lucScalarFieldOnMeshCrossSection_DrawCrossSection( void* drawingObject, double crossSectionValue, Axis axis );
+ void lucScalarFieldOnMeshCrossSection_DrawCrossSection( void* drawingObject, Node_LocalIndex crossSection_I, Axis axis ) ;
Bool lucScalarFieldOnMeshCrossSection_PlotColouredVertex( void* drawingObject, Coord interpolationCoord, Coord plotCoord ) ;
+ void lucScalarFieldOnMeshCrossSection_PlotColouredNode( void* drawingObject, Node_LocalIndex lNode_I ) ;
+
#endif
diff -r 9dac68cbae64 -r 66c7976aa0f4 DrawingObjects/src/ScalarFieldOnMeshCrossSection.meta
--- a/DrawingObjects/src/ScalarFieldOnMeshCrossSection.meta Fri Oct 17 17:44:02 2008 +1100
+++ b/DrawingObjects/src/ScalarFieldOnMeshCrossSection.meta Fri Oct 31 18:37:38 2008 +1100
@@ -3,7 +3,7 @@
<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
<param name="Name">lucScalarFieldOnMeshCrossSection</param>
-<param name="Author">...</param>
+<param name="Author">Cecile Duboz</param>
<param name="Organisation">MCC</param>
<param name="Project">gLucifer</param>
<param name="Location">./</param>
@@ -13,117 +13,79 @@
<param name="Parent">lucOpenGLDrawingObject</param>
<param name="Reference">...</param>
<param name="Summary">...</param>
-<param name="Description">...</param>
+<param name="Description">Tiles a plane with colours derived from the value of a scalar field at the vertex of each tile.</param>
<!--Now the interesting stuff-->
<list name="Params">
- <struct>
- <param name="Name">FieldVariable</param>
- <param name="Type">String</param>
- <param name="Default">"defaultName"</param>
- <param name="Description">...</param>
- </struct>
- <struct>
- <param name="Name">resolution</param>
- <param name="Type">UnsignedInt</param>
- <param name="Default">128</param>
- <param name="Description">...</param>
- </struct>
- <struct>
- <param name="Name">resolutionX</param>
- <param name="Type">UnsignedInt</param>
- <param name="Default">defaultResolution</param>
- <param name="Description">...</param>
- </struct>
- <struct>
- <param name="Name">resolutionY</param>
- <param name="Type">UnsignedInt</param>
- <param name="Default">defaultResolution</param>
- <param name="Description">...</param>
- </struct>
- <struct>
- <param name="Name">resolutionZ</param>
- <param name="Type">UnsignedInt</param>
- <param name="Default">defaultResolution</param>
- <param name="Description">...</param>
- </struct>
<struct>
<param name="Name">crossSection</param>
<param name="Type">String</param>
<param name="Default">""</param>
- <param name="Description">...</param>
+ <param name="Description">The description of the plane in the format: "axis=node". e.g. x=5 will descrive a Y-Z plane where the X nodes are 5 rows in. The axis is case insensitive.</param>
</struct>
<struct>
<param name="Name">minCropX</param>
<param name="Type">Double</param>
- <param name="Default">-HUGE_VAL</param>
- <param name="Description">...</param>
- </struct>
+ <param name="Default">-infinity</param>
+ <param name="Description">The minimum x value that it'll plot for this cross-secion.</param>
+ </struct>
<struct>
<param name="Name">minCropY</param>
<param name="Type">Double</param>
- <param name="Default">-HUGE_VAL</param>
- <param name="Description">...</param>
- </struct>
+ <param name="Default">-infinity</param>
+ <param name="Description">The minimum y value that it'll plot for this cross-secion.</param>
+ </struct>
<struct>
<param name="Name">minCropZ</param>
<param name="Type">Double</param>
- <param name="Default">-HUGE_VAL</param>
- <param name="Description">...</param>
- </struct>
+ <param name="Default">-infinity</param>
+ <param name="Description">The minimum z value that it'll plot for this cross-secion.</param>
+ </struct>
<struct>
<param name="Name">maxCropX</param>
<param name="Type">Double</param>
- <param name="Default">+HUGE_VAL</param>
- <param name="Description">...</param>
- </struct>
+ <param name="Default">+infinity</param>
+ <param name="Description">The maximum x value that it'll plot for this cross-secion.</param>
+ </struct>
<struct>
<param name="Name">maxCropY</param>
<param name="Type">Double</param>
- <param name="Default">+HUGE_VAL</param>
- <param name="Description">...</param>
- </struct>
+ <param name="Default">+infinity</param>
+ <param name="Description">The maximum y value that it'll plot for this cross-secion.</param>
+ </struct>
<struct>
<param name="Name">maxCropZ</param>
<param name="Type">Double</param>
- <param name="Default">+HUGE_VAL</param>
- <param name="Description">...</param>
- </struct>
-
+ <param name="Default">+infinity</param>
+ <param name="Description">The maximum z value that it'll plot for this cross-secion.</param>
+ </struct>
</list>
<list name="Dependencies">
<struct>
<param name="Essential">True</param>
<param name="Name">FieldVariable</param>
- <param name="Type">FieldVariable</param>
- <param name="Description">...</param>
+ <param name="Type">FeVariable</param>
+ <param name="Description">The scalar field that you wish visualise with these tiles.</param>
</struct>
-
-<!-- PLEASE, check the above struct information is accurate, in line number 199 of the c file and then remove this comment afterwards -->
<struct>
<param name="Essential">True</param>
<param name="Name">ColourMap</param>
<param name="Type">lucColourMap</param>
- <param name="Description">...</param>
+ <param name="Description">The colour map to find calculate what colour to use for the scalar value of the field for each sample point.</param>
</struct>
-
-<!-- PLEASE, check the above struct information is accurate, in line number 200 of the c file and then remove this comment afterwards -->
-
- <struct>
- <param name="Essential">True</param>
- <param name="Name">self->fieldVariableName</param>
- <param name="Type">FieldVariable</param>
- <param name="Description">...</param>
- </struct>
-
-<!-- PLEASE, check the above struct information is accurate, in line number 238 of the c file and then remove this comment afterwards -->
-
</list>
<!-- Add an exmaple XML if possible -->
-<param name="Example">...</param>
+<param name="Example">
+ <struct name="temperatureMapXSection">
+ <param name="Type">lucScalarFieldOnMeshCrossSection</param>
+ <param name="FieldVariable">TemperatureField</param>
+ <param name="ColourMap">temperatureColourMap</param>
+ <param name="crossSection">Y=5</param>
+ </struct>
+</param>
diff -r 9dac68cbae64 -r 66c7976aa0f4 DrawingObjects/src/TimeStep.meta
--- a/DrawingObjects/src/TimeStep.meta Fri Oct 17 17:44:02 2008 +1100
+++ b/DrawingObjects/src/TimeStep.meta Fri Oct 31 18:37:38 2008 +1100
@@ -3,7 +3,7 @@
<StGermainData xmlns="http://www.vpac.org/StGermain/XML_IO_Handler/Jun2003">
<param name="Name">lucTimeStep</param>
-<param name="Author">...</param>
+<param name="Author">Cecile Duboz</param>
<param name="Organisation">MCC</param>
<param name="Project">gLucifer</param>
<param name="Location">./</param>
@@ -23,19 +23,19 @@
<param name="Name">colour</param>
<param name="Type">String</param>
<param name="Default">"Black"</param>
- <param name="Description">Colour used to draw the time and frame number</param>
+ <param name="Description">Colour used for the text of the time and frame number.</param>
</struct>
<struct>
<param name="Name">frame</param>
<param name="Type">Bool</param>
<param name="Default">True</param>
- <param name="Description">If True, draws the frame number</param>
+ <param name="Description">If True, draws the frame number.</param>
</struct>
<struct>
<param name="Name">time</param>
<param name="Type">Bool</param>
<param name="Default">False</param>
- <param name="Description">If True, draws the accumuleted time</param>
+ <param name="Description">If True, draws the accumulated time.</param>
</struct>
</list>
@@ -44,5 +44,12 @@
</list>
<!-- Add an exmaple XML if possible -->
-<param name="Example">...</param>
+<param name="Example">
+ <struct name="timeStep">
+ <param name="Type">lucTimeStep</param>
+ <param name="colour">Black</param>
+ <param name="frame">false</param>
+ <param name="time">true</param>
+ </struct>
+</param>
More information about the CIG-COMMITS
mailing list