STLOUT.CPP
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #include "vtk.hh"
00009 #include <stdlib.h>
00010 #include <stdio.h>
00011 #include <math.h>
00012 #include <windows.h>
00013
00014 #define UNIT 32768L
00015 #define DESELECTED 0
00016 #define SELECTED 1
00017 #define INEDITOR 6
00018
00019 #ifdef __cplusplus
00020 extern "C" {
00021 #endif
00022
00023 #include "struct.h"
00024 #include "dstruct.h"
00025
00026 #ifdef __cplusplus
00027 }
00028 #endif
00029
00030 #include "stlout.h"
00031
00032 #include "sfx2vtk.h"
00033 #include "sfx2vtk.cpp"
00034
00035 static HINSTANCE hThisInstance;
00036
00037 #if __WATCOMC__
00038 int APIENTRY LibMain(HANDLE hDLL, DWORD dwReason, LPVOID lpReserved){
00039 #else
00040 BOOL WINAPI DllMain(HANDLE hDLL, DWORD dwReason, LPVOID lpReserved){
00041 #endif
00042 switch (dwReason) {
00043 case DLL_PROCESS_ATTACH: {
00044 hThisInstance=(HINSTANCE)hDLL;
00045 if(hDLL == NULL)MessageBeep(MB_OK);
00046 break;
00047 }
00048 case DLL_PROCESS_DETACH:
00049 break;
00050 }
00051 return TRUE;
00052 }
00053
00054
00055
00056 extern "C" BOOL _Export
00057 (HWND parent_window, char *filename, X__STRUCTURE *lpevi){
00058 HCURSOR hSave;
00059 lpEVI=lpevi;
00060 char localfile[256],szdir[256];
00061 strcpy(szdir,"\\");
00062 if(filename == NULL){
00063 strcpy(localfile,"unnamed.stl");
00064 ChooseFile(1,localfile,szdir,"Save STL","*.stl",parent_window);
00065 }
00066 else strcpy(localfile,filename);
00067 AppendFileExtension(localfile,".stl");
00068 hSave=SetCursor(LoadCursor(NULL,IDC_WAIT));
00069 SfxReader sfxinput;
00070 vtkSTLWriter stlw;
00071 stlw.SetInput(sfxinput.GetOutput());
00072 stlw.SetFilename(localfile);
00073 stlw.Update();
00074 SetCursor(hSave);
00075 return 1;
00076 }
00077