[cig-commits] r3972 - in long/3D/Gale/trunk/src/gLucifer: . DrawingObjects/src

walter at geodynamics.org walter at geodynamics.org
Thu Jul 6 02:12:01 PDT 2006


Author: walter
Date: 2006-07-06 02:12:00 -0700 (Thu, 06 Jul 2006)
New Revision: 3972

Modified:
   long/3D/Gale/trunk/src/gLucifer/
   long/3D/Gale/trunk/src/gLucifer/DrawingObjects/src/ScalarFieldCrossSection.c
Log:
 r56 at earth (orig r592):  PatrickSunter | 2006-07-04 21:24:29 -0700
 Added a Firewall to check that you don't try to 
 visualise the scalar field of a FieldVariable that
 has more than 1 component (this causes weird memory
 errors if you do).
 



Property changes on: long/3D/Gale/trunk/src/gLucifer
___________________________________________________________________
Name: svk:merge
   - 3433ad49-13df-0310-980d-a6a68cf0952a:/trunk:588
d11c8794-cf10-0410-8271-cb625e597d60:/cig:218
   + 3433ad49-13df-0310-980d-a6a68cf0952a:/trunk:592
d11c8794-cf10-0410-8271-cb625e597d60:/cig:218

Modified: long/3D/Gale/trunk/src/gLucifer/DrawingObjects/src/ScalarFieldCrossSection.c
===================================================================
--- long/3D/Gale/trunk/src/gLucifer/DrawingObjects/src/ScalarFieldCrossSection.c	2006-07-06 09:11:56 UTC (rev 3971)
+++ long/3D/Gale/trunk/src/gLucifer/DrawingObjects/src/ScalarFieldCrossSection.c	2006-07-06 09:12:00 UTC (rev 3972)
@@ -228,12 +228,18 @@
 }
 
 void _lucScalarFieldCrossSection_Build( void* drawingObject, void* data ) {
-	lucScalarFieldCrossSection*     self    = (lucScalarFieldCrossSection*)drawingObject;
-	AbstractContext*                context = Stg_CheckType( data, AbstractContext );
-	Stg_ComponentFactory*           cf      = context->CF;
+	lucScalarFieldCrossSection*     self        = (lucScalarFieldCrossSection*)drawingObject;
+	AbstractContext*                context     = Stg_CheckType( data, AbstractContext );
+	Stg_ComponentFactory*           cf          = context->CF;
+	Stream*                         errorStream = Journal_Register( Error_Type, self->type );
 
 	/* 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 );
+	Journal_Firewall( self->fieldVariable->fieldComponentCount == 1, errorStream,
+		"Error - in %s(): provided FieldVariable \"%s\" has %u components - but %s Component "
+		"can only visualise FieldVariables with 1 component. Did you mean to visualise the "
+		"magnitude of the given field?\n", __func__, self->fieldVariable->name,
+		self->fieldVariable->fieldComponentCount, self->type );
 }
 
 void _lucScalarFieldCrossSection_Initialise( void* drawingObject, void* data ) {}



More information about the cig-commits mailing list