To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.cad.devOpen lugnet.cad.dev in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 CAD / Development / 5835
5834  |  5836
Subject: 
Re: Line Thickness and Antialiasing in LdGLite 0.7.3
Newsgroups: 
lugnet.cad.dev
Date: 
Sun, 31 Dec 2000 01:41:10 GMT
Viewed: 
780 times
  
Don Heyse wrote...
In lugnet.cad.dev, Lars C. Hassing writes:
In lugnet.cad.dev, Don Heyse writes:
In lugnet.cad.dev, Lars C. Hassing writes:

[snip] (a bunch of stuff about

I really would like to find the cause of the problem, because L3P relies on the
same routines, and it does work for L3P.
All filenames are internally made lowercase (FixDatName), so I don't have to worry
about any following compares.
Which platform(s) had the problem?

It was on a linux system where I had copied all the DAT files from a
smbmounted Windows filesystem and somehow ended up with them all in UPPERCASE.
This is probably not a normal setup, but it happened to me and I'm too
lazy to write a script file to fix it.  Anyhow I tried to allow for this
with the environment variable LDRAWDIRCASE=UPPERCASE and some code in
platform.c but I was thwarted by strcmp() to hardcoded lowercase special
filenames in L3Input.cpp.  Using stricmp() fixes this and is the approach I
used with the LdLite parser.  I can't think of any reason not to use stricmp

stricmp is slower, though the difference is most likely immeasurable in the big picture.

No, it is more a matter of principle, to know what you are dealing with,
to be in control of of your data - in stead of not really knowing whether
it is necessary or not.

OK I confess, I took the cheap and easy fix rather than digging deeper
to find the root of the problem.  After further consideration I suppose
the correct solution would be to run FixDatName() on all the hardcoded
lowercase filenames when the program is initialized.

Ah, I think I understand now...
You require all DAT files in Linux to be in uppercase?

If you let FixDatName convert to lower case (like I do),
you could modify OpenDatFile to use upper case,
(if that's what you require) and simple strcmp will work in L3Input.cpp.

My approach is like this:
Line type 1 filenames are in "optional" case, i.e people use e.g.
4-4cyli.dat, 4-4CYLI.DAT, 4-4cyli.DAT or 4-4CYLI.dat.
Internally, FixDatName sees to that it is known as 4-4cyli.dat,
so I can use the simple strcmp.

As you cannot rely on the case of the filename in line type 1,
you have to do (on Linux) the case-gymnastics when you later
are going to load the file.
I have already prepared L3P for Linux by writing an OpenDatFile,
which will find e.g. 4-4cyli.dat no matter whether the Linux file is named
4-4cyli.dat, 4-4CYLI.DAT, 4-4cyli.DAT or 4-4CYLI.dat.
(On DOS/Windows you can simply load 4-4cyli.dat and the OS will find it)

I wrote OpenDatFile long time ago on a Solaris Unix system,
but will soon put it into L3Input.cpp, when I get Linux (re)installed.
I don't have it with me, and I can't really remember how thorough
I tested it, but I'll of course make sure it works on Linux.

/Lars



Message is in Reply To:
  Re: Line Thickness and Antialiasing in LdGLite 0.7.3
 
(...) OK I confess, I took the cheap and easy fix rather than digging deeper to find the root of the problem. After further consideration I suppose the correct solution would be to run FixDatName() on all the hardcoded lowercase filenames when the (...) (24 years ago, 30-Dec-00, to lugnet.cad.dev)

15 Messages in This Thread:





Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR