#include "SIERPINSKY_Gen_i.hxx"
#include "SIERPINSKY_version.h"
#include <MED_Factory.hxx>
+#ifndef WIN32
#include <gd.h>
-
-using namespace MED;
+#endif
/*!
* Engine factory
*/
CORBA::Boolean SIERPINSKY_Gen_i::ExportToJPEG( const char* theFileName, CORBA::Long theSize )
{
+#ifndef WIN32
if ( theSize <= 0 ) return false;
// open file
gdImageDestroy( image );
return true;
+#else
+ printf("Warning: ExportToJPEG() is not supported on Windows!");
+ return false;
+#endif
}
/*!
*/
CORBA::Boolean SIERPINSKY_Gen_i::ExportToMED( const char* theFileName, CORBA::Double theSize )
{
- TErr anError;
+ MED::TErr anError;
// if file already exists - remove it (MED cannot overwrite files correctly)
FILE* aFile = fopen( theFileName, "rb" );
}
// create MED 2.2 file
- PWrapper aMed = CrWrapper( theFileName, MED::eV2_2 );
+ MED::PWrapper aMed = MED::CrWrapper( theFileName, MED::eV2_2 );
// create 2D mesh
- PMeshInfo aMesh = aMed->CrMeshInfo( 2, 2, "Sierpinsky" );
+ MED::PMeshInfo aMesh = aMed->CrMeshInfo( 2, 2, "Sierpinsky" );
aMed->SetMeshInfo( aMesh, &anError );
if ( anError < 0 ) return false;
// create nodes
- TFloatVector nodes;
- TIntVector connect;
+ MED::TFloatVector nodes;
+ MED::TIntVector connect;
std::list<MyPoint>::const_iterator iter;
int ind = 1;
for ( iter = myPoints.begin(); iter != myPoints.end(); ++iter ) {
nodes.push_back( (*iter).myY * theSize );
connect.push_back( ind++ );
}
- PNodeInfo aNodes = aMed->CrNodeInfo( aMesh, nodes, MED::eFULL_INTERLACE, MED::eCART, TStringVector(2), TStringVector(2), TIntVector( myPoints.size() ), TIntVector() );
+ MED::PNodeInfo aNodes = aMed->CrNodeInfo( aMesh, nodes,
+ MED::eFULL_INTERLACE, MED::eCART,
+ MED::TStringVector(2),
+ MED::TStringVector(2),
+ MED::TIntVector( myPoints.size() ),
+ MED::TIntVector() );
aMed->SetNodeInfo( aNodes, &anError );
if ( anError < 0 ) return false;
- PCellInfo aCells = aMed->CrCellInfo( aMesh, MED::eMAILLE, MED::ePOINT1, connect, eNOD, TIntVector( myPoints.size() ), TIntVector( myPoints.size() ) );
+ MED::PCellInfo aCells = aMed->CrCellInfo( aMesh, MED::eMAILLE, MED::ePOINT1,
+ connect, MED::eNOD,
+ MED::TIntVector( myPoints.size() ),
+ MED::TIntVector( myPoints.size() ) );
aMed->SetCellInfo( aCells, &anError );
if ( anError < 0 ) return false;