Author Topic: Open Source Survey Package?  (Read 18794 times)

0 Members and 1 Guest are viewing this topic.

Swift

  • Swamp Rat
  • Posts: 596
Re: Open Source Survey Package?
« Reply #90 on: November 01, 2005, 08:39:47 AM »
I began working on a dll this weekend, it seems I had forgotten everything I knew about c++ dlls . So far I have something like

Struct ‘Point’ with No,X,Y,Z,Desc

A class ‘Pts’ with properties
   Vector<Point>
   bPtProtect

With Methods
   ImportTextFile (To Allow for #,Y,X,Z,D  #,X,Y,Z,D comma and space delimited)
   ExportTextFile
   GetPoint( by pt# return a struct)
   GetPoint( by vector index)
   GetPointCount(return vector.count)
   GetPoint3d(pass byref 5 variables)
   EditPoints
   ListPoints
   TranslatePoints
   RotatePoints
   TransformPoints
   
For now I’m going to implement the file dialog boxes with Win32 api. I hope to just use this code as a ‘proof of concept’ so that we can write wrappers for AutoCAD and Intellicad. Also on this first pass I’m going to just implement enough so that we can plot points on the screen. I hope to have it ready in the next couple of days.

Should we also include the CoGo (inverses, intersections, traverse) routines as part of the Pts class or should they be separate?  Does an unsigned int allow for enough points (0 to 65535)? The only time I can think that it wouldn’t be more than enough would be for contouring large aerial photography.


Anything thing I missed? Thoughts? Comments?

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Open Source Survey Package?
« Reply #91 on: November 01, 2005, 09:01:13 AM »
Yeah, what can we do?
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Swift

  • Swamp Rat
  • Posts: 596
Re: Open Source Survey Package?
« Reply #92 on: November 01, 2005, 09:14:14 AM »
How is your file parsing skills in c++?

JohnK

  • Administrator
  • Seagull
  • Posts: 10648
Re: Open Source Survey Package?
« Reply #93 on: November 01, 2005, 09:46:31 AM »
non-existant. I was thinking alog the lines of early lisp tools.
TheSwamp.org (serving the CAD community since 2003)
Member location map - Add yourself

Donate to TheSwamp.org

Swift

  • Swamp Rat
  • Posts: 596
Re: Open Source Survey Package?
« Reply #94 on: November 01, 2005, 10:11:40 AM »
Ok, let me finish the dll. Then we'll have to wrap it in a activex dll. Then we need a point plotting lisp function.

Swift

  • Swamp Rat
  • Posts: 596
Re: Open Source Survey Package?
« Reply #95 on: November 01, 2005, 02:07:49 PM »
How difficult is it to get the current drawing name and path with lisp?

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Open Source Survey Package?
« Reply #96 on: November 01, 2005, 02:13:25 PM »
Code: [Select]
(apply 'strcat
    (mapcar 'getvar
       '("dwgprefix" "dwgname")
    )
)
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Swift

  • Swamp Rat
  • Posts: 596
Re: Open Source Survey Package?
« Reply #97 on: November 01, 2005, 02:19:01 PM »
Thanks MP

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Open Source Survey Package?
« Reply #98 on: November 01, 2005, 02:24:27 PM »
Sorry to be so terse, was just duckin' out for a sandwich.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Swift

  • Swamp Rat
  • Posts: 596
Re: Open Source Survey Package?
« Reply #99 on: November 01, 2005, 07:53:21 PM »
Pardon my ignorance in lisp but...

What is the lifetime of a lisp variable?

If we export a class from the c++ dll and wrap it with an activeX dll and create and instance of it, what is its lifetime? Is it active as long as the drawing is open?

I'm looking for ways to maintain the relationship between the drawing and the coordinate file.

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Open Source Survey Package?
« Reply #100 on: November 01, 2005, 08:00:59 PM »
.. What is the lifetime of a lisp variable?


I'm looking for ways to maintain the relationship between the drawing and the coordinate file.

Till Overwritten or the Drawing closed. < edit : Global variables that is >

Dictionary may work for you. Accessed from all IDE's

« Last Edit: November 01, 2005, 08:06:19 PM by Kerry Brown »
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Chuck Gabriel

  • Guest
Re: Open Source Survey Package?
« Reply #101 on: November 01, 2005, 08:11:15 PM »
... Dictionary may work for you. Accessed from all IDE's

My thoughts exactly.

Swift,

You mentioned needing help parsing the files?

Swift

  • Swamp Rat
  • Posts: 596
Re: Open Source Survey Package?
« Reply #102 on: November 01, 2005, 10:25:40 PM »
... Dictionary may work for you. Accessed from all IDE's

My thoughts exactly.

Swift,

You mentioned needing help parsing the files?

I'll need some Chuck but let me get the framework fleshed out a little more first. Right now I'm playing with dll exports. 'dumpbin' is my friend :D

MP

  • Seagull
  • Posts: 17750
  • Have thousands of dwgs to process? Contact me.
Re: Open Source Survey Package?
« Reply #103 on: November 02, 2005, 12:16:35 AM »
... and make it hard owned and it will survive purging etc.
Engineering Technologist • CAD Automation Practitioner
Automation ▸ Design ▸ Drafting ▸ Document Control ▸ Client
cadanalyst@gmail.comhttp://cadanalyst.slack.comhttp://linkedin.com/in/cadanalyst

Swift

  • Swamp Rat
  • Posts: 596
Re: Open Source Survey Package?
« Reply #104 on: November 06, 2005, 01:13:13 PM »
OK, I've hit a wall trying to get std::vector and std::string to export out of the dll I found http://support.microsoft.com/default.aspx?scid=kb;en-us;168958 but I can't seem to get it to work. Any ideals? I'm working with
Code: [Select]
// The following ifdef block is the standard way of creating macros which make exporting
// from a DLL simpler. All files within this DLL are compiled with the POINTS_EXPORTS
// symbol defined on the command line. this symbol should not be defined on any project
// that uses this DLL. This way any other project whose source files include this file see
// POINTS_API functions as being imported from a DLL, whereas this DLL sees symbols
// defined with this macro as being exported.
//#define POINTS_EXPORTS

//disable warning on 255 char debug symbols
#pragma warning (disable : 4786)
//diasable warnings on extern before template instantiation
#pragma warning (disable : 4231)
//^ as per http://support.microsoft.com/default.aspx?scid=kb;EN-US;168958
#ifdef POINTS_EXPORTS
#define POINTS_API __declspec(dllexport)
#define EXPIMP_TEMPLATE// http://support.microsoft.com/default.aspx?scid=kb;EN-US;168958
#else
#define POINTS_API __declspec(dllimport)
#endif
#include <vector>
#include <string>

struct Point{
unsigned int nPtNo;
double dX;
double dY;
double dZ;
char cDesc[32]; //most data collectors I've seen only support 32 character descriptions
  //although we could make this a string and truncate the string in the export function
};
//////////http://support.microsoft.com/default.aspx?scid=kb;EN-US;168958///////
EXPIMP_TEMPLATE template class DECLSPECIFIER std::vector<Point>;
EXPIMP_TEMPLATE template class DECLSPECIFIER std::string;
///////////////////////////////////////////////////////////////////////////////

// This class is exported from the Points.dll
class POINTS_API CPoints {
//class DECLSPECIFIER CPoints{
//////////////////////////////////Private////////////////////////////////////////////
private:
bool bPtProtect;
std::vector < Point > pts;


/* ^^^^^^^^^^^^^^^^^^^^^^^
Under VC 2002 this gives the following warning, which I haven't investigated yet
"c:\Projects\Survey\Points\Points.h(30): warning C4251:
'CPoints::pts' : class 'std::vector<_Ty,_Ax>'
needs to have dll-interface to be used by clients of class 'CPoints'
        with
        [
            _Ty=Point,
            _Ax=std::allocator<Point>
        ]*/

std::string sPath;
/* ^^^^^^^^^^^^^^^
c:\Projects\Survey\Points\Points.h(31): warning C4251:
'CPoints::sPath' : class 'std::basic_string<_Elem,_Traits,_Ax>'
needs to have dll-interface to be used by clients of class 'CPoints'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>,
            _Ax=std::allocator<char>
        ]
 */
//////////////////////////////////Public////////////////////////////////////////////
public:
CPoints(void); //new drawing
CPoints(std::string path); //path found in existing drawing

int ImportTextFile(void);
int ExportTextFile(void);

// int ImportCarlsonCrd(); // I have these figured out, I will need samples and or specs
// int ExportCarlsonCrd(); // to support other binary formats
int RotatePoints(void);
int TranslatePoints(void);
int EditPoints(void);
int ListPoints(void);
int AddPoint(Point oNewPoint);
int AddPoint(unsigned int nPtNo, double dX, double dY, double dZ, char cDesc[32]);
Point Getpoint(unsigned int PtNo);
int GetPtIndexCount(void);
Point GetPtByIndex(int nPtIndex);
unsigned int GetHighPointNo(void);
int GetPointNoExtremes(unsigned int &LowNo, unsigned int &HighNo);

//////////////////////////////////VB Wrappers////////////////////////////////////////////
void * __stdcall CreatePoint();
void * __stdcall CreatePoint(std::string path);
void * __stdcall DestroyPoint(void * objptr);
//////////////////////////////////VB Wrappers////////////////////////////////////////////
//bool operator < (CPoints) const;

bool operator < (const CPoints c) const
{ return pts <  c.pts; }
bool operator == (const CPoints c) const
{ return pts == c.pts; }
};