Delgine 3D Tools & Content DeleD Community Edition
Forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Organize units in directories
Goto page 1, 2  Next
 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Development
View previous topic :: View next topic  
Author Message
chronozphere
DeleD PRO user


Joined: 20 Jun 2006
Posts: 1010
Location: Netherlands

PostPosted: Sat Jan 16, 2010 3:58 pm    Post subject: Organize units in directories Reply with quote

Hey guys

Would it be possible to organize the units in directories. All those many files in /trunk/units make me dizzy. I'm used to smaller projects (like 20 or 30 files, not 200 Razz )

I was thinking about the following:

--> /Tools/: Most of the units implement some kind of tool. We could make a tools directory (with subdirectories) to organize the tools (vertex tools, primitive tools, skeleton tools, etc etc )
--> /Materials/: All material and texture related code
--> /Animation/: All animation related stuff here
--> /Raytracer/: Allready exists Very Happy

My main concern is having the tool implementations separated from the rest. It's way easier to find your unit when there is a decent directory structure. Razz

Also, we should add a list of units (the important ones) on the wiki and add a little description for each one of them. Smile

Let me know what you think?
Back to top
View user's profile Send private message
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Sat Jan 16, 2010 6:56 pm    Post subject: Reply with quote

As long as we don't end up with < +/- 3 files per folder, I totally agree.

You will be needing a Misc (or whatever you want to call it) folder though, unless you are an absolute wizard at classification. Very Happy
Back to top
View user's profile Send private message Visit poster's website
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Sat Jan 16, 2010 7:02 pm    Post subject: Reply with quote

Yep, I agree too. Be aware though, this would be a rather big, project-wide change. Some coordination (as to when/how/etc) would be needed.
_________________
Check out Figuro, our online 3D app! More powerful 3D tools for free.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Sat Jan 16, 2010 7:07 pm    Post subject: Reply with quote

Why? It just affects the structure and deled.dpr, nothing more. Go ahead and do it, I say. Then commit. If we hate your guts for it we'll simply revert.

Just make sure to move the files using svn (rightclick-drag-and-drop if you are using TortoiseSVN), not the explorer / command line. There isn't much history to keep at the moment, but still. Have to do this the right way.
Back to top
View user's profile Send private message Visit poster's website
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Sat Jan 16, 2010 8:07 pm    Post subject: Reply with quote

Paul-Jan wrote:
Why? It just affects the structure and deled.dpr, nothing more. Go ahead and do it, I say. Then commit. If we hate your guts for it we'll simply revert.

Just make sure to move the files using svn (rightclick-drag-and-drop if you are using TortoiseSVN), not the explorer / command line. There isn't much history to keep at the moment, but still. Have to do this the right way.


Yeah, that's exactly what I mean. I have some bad experience with SVN and moving files and folders (at least combined with Visual Studio projects) so just wanted to make sure that whoever does rearrange the project pays very close attention to what they're doing.

Edit: Visual Studio in combination with AhknSvn and TortoiseSvn I meant. Combining several SVN clients might mess up things.
_________________
Check out Figuro, our online 3D app! More powerful 3D tools for free.


Last edited by Jeroen on Sat Jan 16, 2010 11:09 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chronozphere
DeleD PRO user


Joined: 20 Jun 2006
Posts: 1010
Location: Netherlands

PostPosted: Sat Jan 16, 2010 10:16 pm    Post subject: Reply with quote

Quote:

You will be needing a Misc (or whatever you want to call it) folder though, unless you are an absolute wizard at classification. Very Happy


I think we could leave some "core" components of the code directly in the units/ directory. We could also introduce a "base" directory containing the whole system on which deled is built (abstract classes, enumerations and other definitions). What do you think?

Quote:

Yep, I agree too. Be aware though, this would be a rather big, project-wide change. Some coordination (as to when/how/etc) would be needed.


I was thinking the same thing. Are we sure that the compiler can find all files, even though they are located in subdirectories? (I don't know exactly how Delphi looks for files. Does it iterate through subdirs? )

Quote:

Just make sure to move the files using svn (rightclick-drag-and-drop if you are using TortoiseSVN), not the explorer / command line. There isn't much history to keep at the moment, but still. Have to do this the right way.


Ok, never heard of right-click-dragging before. I'll wait, until we are sure how to organize those files. I'm just an SVN beginner, so you could do it if you want?
Back to top
View user's profile Send private message
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Sun Jan 17, 2010 9:19 am    Post subject: Reply with quote

No offense, but if you don't know exactly how Delphi looks for files in subfolders(*), I'm starting to feel a little less confident about my "just do it" suggestion. Wink Like Jeroen says, stuff like this is an immediate build-breaker if not done right.

There are two ways to address this in a less drastic way:
a) you rearrange the files locally and post your suggested structure here in this thread, and then we all discuss things together
b) We change this forum post into a formal tracker issue, where any developer can discuss it and try to pick it up.

Something like that?

----------------------

For the record,

-> The way Delphi handles files in folders(*),

There are 3 search-levels here:
(1) Through direct reference in the .dpr
(2) Through the project search paths
(3) Through the environment (Delphi-wide) library paths.

Units can also find each other "if located in the same folder", but that is a maintenance nightmare I won't go into.

Of these three levels, DeleD uses only (1), to maintain maximum portability from one machine to the next. The file references all use relative folders, of course.

-> Moving files through TortoiseSVN is fully explained in the manual, here. Make sure you practice a bit with this functionality before doing it on a live project! It's really simple once you get the hang of it.
Back to top
View user's profile Send private message Visit poster's website
chronozphere
DeleD PRO user


Joined: 20 Jun 2006
Posts: 1010
Location: Netherlands

PostPosted: Sun Jan 17, 2010 11:54 am    Post subject: Reply with quote

Quote:

No offense, but if you don't know exactly how Delphi looks for files in subfolders(*), I'm starting to feel a little less confident about my "just do it" suggestion. Wink Like Jeroen says, stuff like this is an immediate build-breaker if not done right.


Sorry.. The only thing I didn't know was whether delphi searches through subdirectories. Often I couldn't get a library working, so I started doing some trial and error until it worked. I often added search paths to either the enviroment or a project. As a last option I moved things to the /lib/ directory, which is just "wrong". (But that was years ago lol).

Quote:

There are 3 search-levels here:
(1) Through direct reference in the .dpr
(2) Through the project search paths
(3) Through the environment (Delphi-wide) library paths.


Never seen this info. Thanks alot. Very Happy Now I can ditch my trial 'n error way of getting things working.

Quote:

a) you rearrange the files locally and post your suggested structure here in this thread, and then we all discuss things together


I think this would be the best option. It gives me the chance to learn and to contribute at the same time. Smile I'll make a local copy and try to make a working build. I'll keep you guys posted.

I'll make sure all files are referened by the DPR (Chronoz looks at DPR now!!)
Back to top
View user's profile Send private message
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Sun Jan 17, 2010 12:16 pm    Post subject: Reply with quote

Sweet, looking forward to what you come up with!
Back to top
View user's profile Send private message Visit poster's website
chronozphere
DeleD PRO user


Joined: 20 Jun 2006
Posts: 1010
Location: Netherlands

PostPosted: Mon Jan 18, 2010 9:21 pm    Post subject: Reply with quote

Organizing all the files is really tedious and boring. Mad But i'm not going to give up that easily, because I just know everyone will benefit.

It'll probably take more than a week to re-structure everything (Keep in mind that i'm busy with other things aswell Wink )
Back to top
View user's profile Send private message
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Tue Jan 19, 2010 3:23 pm    Post subject: Reply with quote

Hang in there! Keep in mind that if it had been Loads Of Fun (And Really Simple) to restructure the file tree it would probably have been done ages ago. Wink
Back to top
View user's profile Send private message Visit poster's website
chronozphere
DeleD PRO user


Joined: 20 Jun 2006
Posts: 1010
Location: Netherlands

PostPosted: Fri Jan 22, 2010 10:17 am    Post subject: Reply with quote

Ok, I propose the following:

Quote:

======= Directories ==========

Base/
Base/Animation/
Base/Bone/
Base/Joint/
Base/Skeleton/
Base/Primitive/
Base/Materials/
Base/Lights/
FileFormats/
Textures/
UI/
Utils/
Libs/
Misc/

Tools/
Tools/Animation/
Tools/Bone/
Tools/Vertex/
Tools/Edge/
Tools/Polygons/
Tools/Face/
Tools/Primitive/
Tools/Creation/
Tools/CSG/
Tools/Joint/
Tools/Skeleton/

========= Remove =========

//Units do not appear to be used
unit_BHV.pas
unit_Raytracer.pas
unit_GeometryManipulator.pas


Explanation:

Base contains all abstract/often-used code that forms the structure of DeleD. Some files are stored directly in "base/" while others are put in one of the subdirectories.

Tools contains all tool specific code (abstract tool definitions are in base/). All tools are categorized into sub-directories.

Fileformats contains all XML, DMF and DML related code.

Textures: Pretty self explaining, i guess. Smile

UI: All UI specific code (either reusable elements or big objects like the viewport-manager).

Utils: Powerfull utilities that are used all over the place, but have few dependancies themselves (math, string-utils, datastructures).

Libs: External libraries and their utilities

(This needs to be on the wiki Razz )

Some directories contain very few files, but I decided to add them anyway, for consistency.

What do you think? Can I commit it if I can make this buildable? Smile
Back to top
View user's profile Send private message
Paul-Jan
Site Admin


Joined: 08 Aug 2004
Posts: 3066
Location: Lage Zwaluwe

PostPosted: Fri Jan 22, 2010 2:58 pm    Post subject: Reply with quote

First of all, excellent work.

- I like your basic structure, but I'm waiting for the responses by others. Mainly JC. Smile
- I do think you might have overdetailed a bit here and there, for instance I don't see Base/Lights containing more than a single file (unit_lights). A folder containing a single file is overdoing it (i.e. makes it harder to navigate, not easier). Then again, one could argue that unit_lights should be split up, and consistency is good.
- I just deleted the tree obsolete files from the repository. Good job spotting them, now you don't have to worry about them any longer.
- It is really important that you move these files through the versioning system (i.e. shift-move in tortoisesvn) to keep their history. Even though we don't have much history, this has to be done right on principle. Because of this, I'd very much prefer to this trough a patch (I am assuming the patch format properly supports) so the moves can be verified by a second pair of eyes before they end up into the repository. Shouldn't matter too much for your workflow, just do your thing, then generate a patch and submit it to sourceforge in stead of doing the commit.
Back to top
View user's profile Send private message Visit poster's website
chronozphere
DeleD PRO user


Joined: 20 Jun 2006
Posts: 1010
Location: Netherlands

PostPosted: Fri Jan 22, 2010 5:47 pm    Post subject: Reply with quote

Good... I'll take another close look at it. You are right about the lights. On the other hand, the directory will not contain a single file. It will also contain the tree "light builder" units. Smile

I'm not too sure about the Bone tools though.. There's only a single file (BoneremoverTool AFAIK). I think I better put this one in "Tools/". On the other hand, It will then be the only file there (the rest are sub-dirs).
Back to top
View user's profile Send private message
Jeroen
Site Admin


Joined: 07 Aug 2004
Posts: 5332
Location: The Netherlands

PostPosted: Fri Jan 22, 2010 6:58 pm    Post subject: Reply with quote

I like the structure as well. I don't mind having only 1 file in a directory if the file logically needs to be separated from the rest.

I do have questions about the UI directory. The user-interface of DeleD consists of forms, frames and a number of additional units. Further detailing of that directory might be a good idea.
_________________
Check out Figuro, our online 3D app! More powerful 3D tools for free.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    DeleD Community Edition Forum Index -> DeleD Development All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum