[cig-commits] commit: Preparing the meshing system for AMR.

Mercurial hg at geodynamics.org
Mon Nov 24 11:28:58 PST 2008


changeset:   23:c88213e3699b
user:        LukeHodkinson
date:        Tue Sep 25 07:55:50 2007 +0000
files:       DrawingObjects/src/FeVariableSurface.c DrawingObjects/src/MeshViewer.c DrawingObjects/src/ScalarFieldOnMeshCrossSection.c
description:
Preparing the meshing system for AMR.


diff -r d52d1d39d0d9 -r c88213e3699b DrawingObjects/src/FeVariableSurface.c
--- a/DrawingObjects/src/FeVariableSurface.c	Sun Sep 09 01:06:43 2007 +0000
+++ b/DrawingObjects/src/FeVariableSurface.c	Tue Sep 25 07:55:50 2007 +0000
@@ -39,7 +39,7 @@
 *+		Patrick Sunter
 *+		Greg Watson
 *+
-** $Id: FeVariableSurface.c 694 2007-05-22 03:17:41Z LukeHodkinson $
+** $Id: FeVariableSurface.c 734 2007-09-25 07:55:50Z LukeHodkinson $
 ** 
 **~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
 
@@ -231,6 +231,7 @@ void _lucFeVariableSurface_BuildDisplayL
 	Node_LocalIndex                lNode_I;
 	double                         nodeValue;
 	double                         height;
+	IArray*				inc;
 
 	FeVariable_SyncShadowValues( feVariable );
 
@@ -249,8 +250,11 @@ void _lucFeVariableSurface_BuildDisplayL
 	else
 		lucColour_SetOpenGLColour( &self->colour );
 
+	inc = IArray_New();
 	for ( lElement_I = 0 ; lElement_I < elementLocalCount ; lElement_I++ ) {
-		FeMesh_GetElementNodes( mesh, lElement_I, &elementNodeCount, &elementNodes );
+	  FeMesh_GetElementNodes( mesh, lElement_I, inc );
+		elementNodeCount = IArray_GetSize( inc );
+		elementNodes = IArray_GetPtr( inc );
 
 		glBegin( GL_POLYGON );
 		for ( eNode_I = 0 ; eNode_I < elementNodeCount ; eNode_I++ ) {
@@ -272,4 +276,6 @@ void _lucFeVariableSurface_BuildDisplayL
 	}
 	glPolygonMode( GL_FRONT_AND_BACK, GL_FILL );
 	glEnable( GL_LIGHTING );	
-}
+
+	NewClass_Delete( inc );
+}
diff -r d52d1d39d0d9 -r c88213e3699b DrawingObjects/src/MeshViewer.c
--- a/DrawingObjects/src/MeshViewer.c	Sun Sep 09 01:06:43 2007 +0000
+++ b/DrawingObjects/src/MeshViewer.c	Tue Sep 25 07:55:50 2007 +0000
@@ -588,6 +588,7 @@ void lucMeshViewer_RenderEdges_WithInc( 
 void lucMeshViewer_RenderEdges_WithInc( lucMeshViewer* self, vertexFuncType* vertexFunc ) {
 	unsigned	nEdges;
 	unsigned	nIncVerts, *incVerts;
+	IArray*		inc;
 	unsigned	e_i;
 
 	assert( self );
@@ -597,8 +598,11 @@ void lucMeshViewer_RenderEdges_WithInc( 
 	nEdges = Mesh_GetLocalSize( self->mesh, MT_EDGE );
 	glDisable(GL_LIGHTING);
 	glBegin( GL_LINES );
+	inc = IArray_New();
 	for( e_i = 0; e_i < nEdges; e_i++ ) {
-		Mesh_GetIncidence( self->mesh, MT_EDGE, e_i, MT_VERTEX, &nIncVerts, &incVerts );
+		Mesh_GetIncidence( self->mesh, MT_EDGE, e_i, MT_VERTEX, inc );
+		nIncVerts = IArray_GetSize( inc );
+		incVerts = IArray_GetPtr( inc );
 		assert( nIncVerts == 2 );
 
 		vertexFunc( Mesh_GetVertex( self->mesh, incVerts[0] ) );
@@ -606,6 +610,8 @@ void lucMeshViewer_RenderEdges_WithInc( 
 	}
 	glEnd();
 	glEnable(GL_LIGHTING);
+
+	NewClass_Delete( inc );
 }
 
 void lucMeshViewer_RenderEdges( lucMeshViewer* self, vertexFuncType* vertexFunc ) {
diff -r d52d1d39d0d9 -r c88213e3699b DrawingObjects/src/ScalarFieldOnMeshCrossSection.c
--- a/DrawingObjects/src/ScalarFieldOnMeshCrossSection.c	Sun Sep 09 01:06:43 2007 +0000
+++ b/DrawingObjects/src/ScalarFieldOnMeshCrossSection.c	Tue Sep 25 07:55:50 2007 +0000
@@ -301,6 +301,7 @@ void lucScalarFieldOnMeshCrossSection_Dr
 	Node_Index           elNode_I;
 	Element_LocalIndex   element_lI;
 	unsigned	 nIncVerts, *incVerts;
+	IArray		*inc;
 
 	
 	glDisable(GL_LIGHTING);
@@ -375,9 +376,11 @@ void lucScalarFieldOnMeshCrossSection_Dr
 	 /* 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, 
-				   &nIncVerts, &incVerts );
+		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);
@@ -408,8 +411,9 @@ void lucScalarFieldOnMeshCrossSection_Dr
 
 	/** 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, 
-			   &nIncVerts, &incVerts );
+	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 
@@ -436,6 +440,8 @@ void lucScalarFieldOnMeshCrossSection_Dr
       	}
 	#endif
 	glEnable(GL_LIGHTING);
+
+	NewClass_Delete( inc );
 }
 
 



More information about the CIG-COMMITS mailing list