Recent

Author Topic: CAD program written in Lazarus / FPC  (Read 188673 times)

trayres

  • Jr. Member
  • **
  • Posts: 92
Re: CAD program written in Lazarus / FPC
« Reply #135 on: July 14, 2015, 07:21:53 am »
You beat me to it  :D

[Edit]
After removing the code snippet from generalviewarea.pas, I get this error:
strproc.pas(49,49) Error: Identifier not found "RawByteString"

I tried to add this:
Code: [Select]
type
  RawByteString = type AnsiString(CP_NONE);

And I got this:
strproc.pas(50,35) Error: Identifier not found "CP_NONE"
« Last Edit: July 14, 2015, 07:35:28 am by trayres »

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #136 on: July 14, 2015, 07:53:21 am »
>>strproc.pas(49,49) Error: Identifier not found "RawByteString"
You need trunk fpc to try zcad. This problem is solved, but there will be new errors associated with generics, it not solve with 2.6.x

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #137 on: July 14, 2015, 09:49:00 am »
Quote
[Edit] I downloaded from svn @ http://svn.shamangrad.net/zcad/trunk/ and found the missing file; it just isn't @ http://svn.shamangrad.net/zcad/trunk/cad_source/simplecad/
You need checkout all sources from svn.shamangrad.net/zcad/trunk/, simplecad is just a small part and it requires a lot of zcad files

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #138 on: August 01, 2015, 09:23:06 am »
Hi all!
New minor release 1375.
- GDI render backend can now display text entities (SHX and TTF) in the drawing.
Now you can draw using GDI instead of OpenGL, but on large drawings, the display speed will be significantly less
Fix it in new 1445 release. Performance of ttf and shx fonts when using the gdi backend has increased

jc99

  • Hero Member
  • *****
  • Posts: 553
    • My private Site
Re: CAD program written in Lazarus / FPC
« Reply #139 on: August 01, 2015, 06:17:32 pm »
Hi zamtmn,

You did quite a job here ! (WTG)
I just came across the same error as trayres when I read to use trunc fpc.
So there is no way to compile zcad with release fpc ?
One other thing: when opening the zcad.lpi all files in the except zcad.pas are striked out (not found).
It would be a good thing to do some cleanup here. (If you have time ... )
So keep the good work ...

[Edit]
Could you update the release.inc before the next commit (it was on 1386 and should have been at 1445)

« Last Edit: August 01, 2015, 06:20:42 pm by jc99 »
OS: Win XP x64, Win 7, Win 7 x64, Win 10, Win 10 x64, Suse Linux 13.2
Laz: 1.4 - 1.8.4, 2.0
https://github.com/joecare99/public
'~|    /''
,_|oe \_,are
If you want to do something for the environment: Twitter: #reduceCO2 or
https://www.betterplace.me/klimawandel-stoppen-co-ueber-preis-reduzieren

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #140 on: August 02, 2015, 06:43:31 pm »
jc99
Quote
So there is no way to compile zcad with release fpc ?
There are many minor inconsistencies, most of them are easily fixable. But I can't solve some problems with generics. With older releases of compilers (2.6.x) I get errors, for example:
Code: [Select]
Error: Incompatible types: got "TMap$QWord$ShortString$TLess$QWord.TSet$TPair$TMapCompare$TPair$TLess$QWord.PNode" expected "TMap$Pointer$QWord$TLess$Pointer.TSet$TPair$TMapCompare$TPair$TLess$Pointer.TSetIterator$TPair$Node.PNode"I can fix all the minor incompatibilities, but for generics I need some help from people who understand this more. If there will be such people, then it is feasible.

Quote
when opening the zcad.lpi all files in the except zcad.pas are striked out (not found).
This is a consequence of the recent changes in the file structure of the project. I don't use that, so I don't notice it. Will fix soon.

Quote
Could you update the release.inc before the next commit (it was on 1386 and should have been at 1445)
Normal content of this file "const RevisionStr = 'Unknown';". I enter the version number there only for publication. But sometimes I forget it, and commit these changes. Will fix soon.

Thanks!
« Last Edit: August 02, 2015, 06:45:54 pm by zamtmn »

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #141 on: August 03, 2015, 01:59:25 pm »
I made a small example, if this can be solved - zcad will work with fpc 2.6.4
http://forum.lazarus.freepascal.org/index.php/topic,29243

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #142 on: August 17, 2015, 11:13:27 am »
Hi all!
All attempts to compile zcad  with the 2.6.4 failed. Perhaps if only to abandon the use of generics, but  I can`t do, on the contrary want to use them more, they are very helpful.
Only 3.0 (when released) and trunk((

Now I'm trying to implement a render text entities with system drawing tools. To do this I need to be able to operate with rotate and oblique angles, separate scale factor for x and y axis. See animated gif http://i71.fastpic.ru/big/2015/0817/b3/0b8a1ae583bde82c06037c8f144184b3.gif and attached test program (win only)

In native GDI calls has functions who I needed:
Code: [Select]
function SetGraphicsMode(hdc:HDC; iMode:longint):longint; external 'gdi32' name 'SetGraphicsMode';
function SetWorldTransform(_para1:HDC; var _para2:XFORM):WINBOOL; external 'gdi32' name 'SetWorldTransform';
function ModifyWorldTransform(_para1:HDC; var _para2:XFORM; _para3:DWORD):WINBOOL; external 'gdi32' name 'ModifyWorldTransform';

But it missed in LCLIntf.pas, so it is not cross-platform((. Is it possible to adapt the test program for GTK2 and Qt?
« Last Edit: August 17, 2015, 11:16:08 am by zamtmn »

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #143 on: August 21, 2015, 07:00:32 pm »
Hi all!
After rev 1466 zcad can use GDI text out procedures to draw text entitys
Animated gif ~3Mb http://fastpic.ru/view/69/2015/0821/_5833b1d8d50c33e9fac663a598d8cfdf.gif.html
TRT_System - GDI text render, faster and more beautiful
TRT_ZGL - old internal zcad text render
TRT_Both - both ways at once, just to see the difference in pixels

Hansvb

  • Hero Member
  • *****
  • Posts: 602
Re: CAD program written in Lazarus / FPC
« Reply #144 on: August 22, 2015, 12:58:42 pm »
Hi, are there plans to read and write to oracle spatial format?

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #145 on: August 22, 2015, 01:01:28 pm »
No such plans. I have never encountered this format

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #146 on: October 15, 2015, 12:26:33 am »
Hi all!
Small separation of the zcad source code. I place to a separate package object inspector used in zcad https://svn.shamangrad.ru/zcad/trunk/cad_source/components/zobjectinspector/
It is quite functional component allowing to display and edit complex data structures directly in memory.

It supports records, objects, arrays and pointers types. Reading a data structure while it is only possible from an external file with pascal syntax, but it allows you to define data structures unknown at compile time.

a small example of usage is attached https://svn.shamangrad.ru/zcad/trunk/cad_source/components/zobjectinspector/samples/objinspbasic/mainform.pas

Works only with fpc 2.7.1 and later((
« Last Edit: October 15, 2015, 12:32:32 am by zamtmn »

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #147 on: November 22, 2015, 08:13:04 pm »
Hi all!
Some progress in removing the internal dependencies in the program.
Simplecad example (http://svn.shamangrad.net/zcad/trunk/cad_source/simplecad/umainform.pas) has become more simple and clean, also I added some comments
« Last Edit: November 22, 2015, 08:19:07 pm by zamtmn »

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #148 on: March 23, 2016, 06:43:34 am »
Hi all!
A bit of cleaning up in the sources - finally separated the graphic engine and ZCAD. Removed all dependencies inside of the engine to ZCAD functions.
At the same time have moved all the units to folders by appointment and totally all renamed: zcxxxxx.pas zcad file, zexxxxx.pas - file engine. Renaming until not touches the containers, I'm thinking to change this nightmare from D6 times on something based on generics

Tried PasDoc to generate the documentation - very good looks... it remains only to comment on at least the main points

zamtmn

  • Hero Member
  • *****
  • Posts: 594
Re: CAD program written in Lazarus / FPC
« Reply #149 on: November 07, 2016, 09:28:19 am »
Hi all!
Now zobjectinspector can register data types by rtti (only records, pointers and enumerated types), without external file parsing. Example - https://svn.shamangrad.ru/zcad/trunk/cad_source/components/zobjectinspector/samples/objinsprtti/

 

TinyPortal © 2005-2018