STLCON.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 "stlcon.h"
00031
00032 #include "sfx2vtk.h"
00033 #include "sfx2vtk.cpp"
00034
00035 static HWND hParent;
00036 static HINSTANCE hThisInstance;
00037
00038
00039 #if __WATCOMC__
00040 int APIENTRY LibMain(HANDLE hDLL, DWORD dwReason, LPVOID lpReserved){
00041 #else
00042 BOOL WINAPI DllMain(HANDLE hDLL, DWORD dwReason, LPVOID lpReserved){
00043 #endif
00044 switch (dwReason) {
00045 case DLL_PROCESS_ATTACH: {
00046 hThisInstance=(HINSTANCE)hDLL;
00047 if(hDLL == NULL)MessageBeep(MB_OK);
00048 break;
00049 }
00050 case DLL_PROCESS_DETACH:
00051 break;
00052 }
00053 return TRUE;
00054 }
00055
00056
00057 extern "C" long _Convert
00058 (HWND parent_window, char *iname, char *oname, X__STRUCTURE *lpevi){
00059 HCURSOR hSave;
00060 lpEVI=lpevi;
00061 hParent=parent_window;
00062 hSave=SetCursor(LoadCursor(NULL,IDC_WAIT));
00063
00064 SfxWriter sfxoutput;
00065 vtkSTLReader *stl;
00066 stl = new vtkSTLReader;
00067 stl->SetFilename(iname);
00068 sfxoutput.SetInput(stl->GetOutput());
00069 sfxoutput.Write();
00070 delete stl;
00071
00072 SetCursor(hSave);
00073 return 0;
00074 }
00075
00076