Hello, For this project I'm going to develop, I have to implement the base structure of a system that holds data taken from 3D files. The basic structure I've implemented is: class 3DPoint { //Point data } class 3DLine { List<3DPoint>... // class methods } class 3DModel { List<3DLine>... // class methods } So far this works well, and it suits my needs. Now I want to derive these classes to allow drawing with OpenGl, because I need some specific fields like "visibility, selected, ...", and that's when I ran into some troubles, because when I derive 3DModel (gl3DModel), I'm forced to use the class 3DLine, and not the derived class (gl3DLine), and the same with 3DPoint. Does any of you have any suggestion on how to do this? Thanks!
rsaint27
Posts
-
3D architecture -
Handling Text data taken from fileThanks again for your help, And :sigh: :-O I'll look better in reference documentation before posting here.
-
Handling Text data taken from fileIt's a good sugestion, especially with the use of a "Predicate" in the search field. However, now I've got a new question... ;) Is it possible with .net 2.0 to get a range of data between known delimiters using predicate's? This would be soooo much cleaner. Thanks for the hint.
-
Handling Text data taken from fileHello, I'm doing some free-time programming with learning objective (in c#), and one of my "projects" led me to separate data taken from a text file. Opening and retrieving data is no problem, I just put it into a ArrayList of string element for now. But when I want to separate the data from that ArrayList, the only solution I've come up with is as 'ugly' as this one: ArrayList stream = new ArrayList(); (some code here) foreach (string str in stream) { if (str.contains(some string)) { do something } else { if (str.contains(some other string)) { do other thing } else { (... even more if's) } } } I think there should be another way to do this, specially without so much "contains" operations that are time consuming. Can you give me some directions on how to break such items apart? I'm thinking this could also be used in other areas like socket communication. This feels like a very dumb question to me, but if I don't ask, I'll never learn. Thanks for any help you can give me.
-
Handling text data retrieved from fileHello, I'm doing some free-time programming with learning objective (in c#), and one of my "projects" led me to separate data taken from a text file. Opening and retrieving data is no problem, I just put it into a ListArray<> of string element for now. But when I want to separate the data from that ListArray, the only solution I've come up with is as 'ugly' as this one: (some code here) foreach (string str in stream) { if (str.contains(some string)) { do something } else { if (str.contains(some other string)) { do other thing } else { (... even more if's) } } } I think there should be another way to do this, specially without so much "contains" operations that are time consuming. Can you give me some directions on how to break such items apart? I'm thinking this could also be used in other areas like socket communication. This feels like a very dumb question to me, but if I don't ask, I'll never learn. Thanks for any help you can give me.
-
c# class design helpHello, I'm building a base class to hold information taken from a robot movement file. This means I have several lines, each with a set of points, and sometimes commands, between the points. Each point has some data (coordinates, orientation, zone, speed, work object, and a few more). I'm using Eran Kampf's Sharp3D math library. I would like a sugestion on how to implement the base class. So far, I've done the following: using Sharp3D.Math.Core using Sharp3D.Math.Geometry3D namespace ModelClass { #region Class constants public enum Linetypes { undefined = -1, laser = 0, water = 1, glue = 2, primer = 3, rough = 4 } public enum Polysides { undefined = -5, none = -1, right = 0, left = 1 } #endregion public class Point7D { // Represents a point in 3D space Vector3F vector; // Represents the quaternion of vector associated with point QuaternionD quaternion; // Point name descriptor string name; } (...) public class RobotPoint : Point7D { #region Constants public enum zones { undefined, fine, z0, z1, z5 } public enum speeds { undefined, v5, v10, v100, v1000 } const string ActiveTool = "ActiveTool"; const string AuxPointData = "[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]"; #endregion #region Internal fields // Workplace definition string workplace; // Tool defined for the point string tool; // Zone definition zones zone; // Speed definition speeds speed; #endregion } public class PolyLine7D { #region Internal Fields List pointList; string name; Linetypes type; Polysides polyside; #endregion } public class Model { #region Internal Fields List _ModelPolylines; string _ModelFileName; #endregion } } Should the class PolyLine implement itself a static method for creating a list, instead of having the Model class do it? Same question for the Model class if I want to have more than one file opened at the same time? In such case, I would crea
-
Class design helpHello, I'm building a base class to hold information taken from a robot movement file. This means I have several lines, each with a set of points, and sometimes commands, between the points. Each point has some data (coordinates, orientation, zone, speed, work object, and a few more). I'm using Eran Kampf's Sharp3D math library. I would like a sugestion on how to implement the base class. So far, I've done the following: using Sharp3D.Math.Core using Sharp3D.Math.Geometry3D namespace ModelClass { #region Class constants public enum Linetypes { undefined = -1, laser = 0, water = 1, glue = 2, primer = 3, rough = 4 } public enum Polysides { undefined = -5, none = -1, right = 0, left = 1 } #endregion public class Point7D { // Represents a point in 3D space Vector3F point; // Represents the quaternion of vector associated with point QuaternionD quaternion; // Point name descriptor string name; } (...) public class RobotPoint : Point7D { #region Constants public enum zones { undefined, fine, z0, z1, z5 } public enum speeds { undefined, v5, v10, v100, v1000 } const string ActiveTool = "ActiveTool"; const string AuxPointData = "[0,0,0,0],[9E+09,9E+09,9E+09,9E+09,9E+09,9E+09]]"; #endregion #region Internal fields // Workplace definition string workplace; // Tool defined for the point string tool; // Zone definition zones zone; // Speed definition speeds speed; #endregion } public class PolyLine7D { #region Internal Fields List pointList; string name; Linetypes type; int width; int npasses; int npts; int power; Polysides polyside; #endregion } public class Model { #region Internal Fields double front_tolerance; double back_tolerance; double inside_x_sep; double outside_x_sep; double plan_overlap; List _ModelPolylines; string _ModelFileName; #endregion } } Should the cla
-
PS/2 to USB Adapter DiagramHello :) I don't know where you are looking, but I've found very easilly an adapter to connect PS/2 keyboard and mouse to a USB port. I'm using it at home to work with an old keyboard on my laptop...
-
Class declaration inside loopsGoing a bit deeper, if I have namespace Whatever { class Base { ... } class Model { List myList = new List(); my fields and methods } class Program { static void Main { Var declaration ... while (condition) { Model temp = new Model(); ... ... } } } } Do I have to implement in the Base class the :Idisposable interface? I've tried to implement it on Model class, and I have an error at execution, that has something to do with infinite loops, when the Model.Dispose() method is called. Thanks for your quick answer, previously.
-
Class declaration inside loopsThanks! :)
-
Class declaration inside loopsHello, I would like to know what happens to a class when I declare it inside a loop. Is it eliminated by the GC when the cycle ends, before a new instance of the same is created? An example: namespace Whatever { class Model { my fields and methods } class Program { static void Main { Var declaration ... while (condition) { Model temp = new Model(); ... ... } } } } Am I doing it correctly? Thanks in advance for the attention.
-
The Rules of MarriagePawel Gielmuda wrote:
I hope that my marriage that starts 1september will be also good.
What a coincidence, Pawel... I'm also getting married 1st September. ;) Congratulations, and the best for you. Great words of wisdom we see in this post! :-D
-
JOTDMike Hankey wrote:
I've been married to your sister for 36 years!
:laugh::laugh::laugh:
-
My speed:omg::laugh:
-
Changing minds. No D40! [DSLR Camera]Hello, I had a similar quest some time ago, and I've choosed the EOS400D. It's a fantastic DSLR camera for non-professional photographers, and even a good backup-camera for professional with Canon SLR lenses. :-D
VuNic wrote:
When you look at the pitures (Web samples), Nikons snaps taken with standard settings has more "reddish"ness. In Canon, it's suppressing the reddishness. It's more White-yellow-brown oriented.
Canon is known for it's "cold" colors, which means you'll have to tweak a little bit with the White Balance to get a warmer palette, but this is easy to do. :-> My sugestion is for you to buy a "decent" lens as soon as possible, and you'll see much improvement in the photo's quality. Hope my exeperience helps! :-O
-
C# / .NET 3D Math Framework [modified]Thanks! I will look into it. Still, if I keep thinking about using OpenGl, anyone has more sugestions? Rui
-
C# / .NET 3D Math Framework [modified]Hello, I'm trying to develop an application that handles 3D data (points, vectors, lines, distance between points, parallels, orientations) and plots it using OpenGl. Do you know of any good 3D Math library to use with c#? For OpenGl I will try to use Tao Framework. By the way, in case this is not the rigth forum, where should I post this? Thanks in advance :) Just a c# newbie :-O -- modified at 12:11 Tuesday 3rd July, 2007
-
C# or .NET 3D Math LibraryHello, I'm trying to develop an application that handles 3D data and plots it using OpenGl. Do you know of any good 3D Math library to use with c#? For OpenGl I will try to use Tao Framework. Thanks in advance Just a c# newbie :)
-
C# 3DMath library [modified]Hello, I'm trying to develop an application that handles 3D data and plots it using OpenGl. Do you know of any good 3D Math library to use with c#? For OpenGl I will try to use Tao Framework. By the way, in case this is not the rigth forum, where should I post this? :doh: Thanks in advance :) Just a c# newbie :rolleyes: -- modified at 19:05 Tuesday 26th June, 2007
-
Systray Graph for Network ActivityDo you know any tool / library that we can use to put in a program to see these graphs (green/red lights will do fine)? It won't matter if we only check one port. Basically I want to show if the program is sending/receiving data thru a specific socket. Thanks!