Thanks, I'll look into it.
I appreciate the help
User Profile
Collapse
-
"if you want to share references between instances of triangle note that reference class members must be initialized in the constructors initializer list and ofc, once initialized they cant be reset to reffer to some other object of their type."
Could you elaborate? I just now rewrote the header like this to allow the sharing of vertices. Is it correct?
...Code:class Triangle: public rendering::HitAble {Leave a comment:
-
I see, thank you.
I'm guessing my best option will be to just store references or pointers instead of the objects, since I would like to share vertices between triangles.
Another question; in the context of randomVertex-function you described:
Is it possible to return a pointer to an object created in the body of the function like so?
...Code:Vertex* generateRandomVertex() { //generate randomLeave a comment:
-
yes savage, I realise that. I just don't get why C++ forces me to have a default constructor, even when I only wanted parametrized constructors. Anyway, newb16's paramater list did to the trick. No default constructor needed.Leave a comment:
-
I know, but I can't see why. What I'm trying to do there is creating a constructor for a Triangle that takes three Vertex-objects as parameters. I really don't see how having a default constructor for a vertex is relevant.
I choose to only provide a constructor for a Vertex that takes x,y,z - coordinates. The constructor for a Triangle has no concern in this, it should just accept whatever three vertex-objects I give it when I use it,...Leave a comment:
-
How to pass objects to constructor?
Hi,
I am a Java developper, and now I'm trying to learn C++. I'm very new to the programming language. I'm trying to pass objects to a constructor, which I appear to be doing wrong.
A triangle-object needs to contain references to 3 "Vertex" objects, which are the points of the triangle.
Triangle.h
...Code:#ifndef TRIANGLE_H_ #define TRIANGLE_H_ #include "Vertex.h"
-
-
Variable number of fields
I need to create a class which offers a variable amount of fields. These fields might be String or int.
Example:
myObject1 might have as fields:
description - String
idNumber - int
authorName - String
myObject2 might contain
description - String
idNumber - int
authorName - String
year - int
myObject1 and myObject2 should be objects of the same class.... -
Java webpage interaction
Hi, I'm looking for classes of libraries that would allow me to have a program interact with a webpage. I would like to be able to have my java program enter strings in textfields, and 'click' buttons.
A simple example would be having the java program enter a certain string in google's search field on google.com, and pressing the search button.
Any suggestions?
Thanks -
Implementing my own version of ListModel holding an Arraylist did the trick.Leave a comment:
-
I thought I should provide some more info.
I have a program on which I have to build a GUI. I may not change anything inside the program. I can get the arrayList to display using a public inspector from the program and this is the only thing I can use to hook it up to a JList.
I have no clue on how to do this in an easy way. I've googled around, finding info on listeners, events, but I don't see a clear solution.Leave a comment:
-
Swing JList displaying arraylist
hi,
I have an arrayList in my program that I want to display in a Jlist. I need the JList to update his contents when the elements in the arraylist change/ an element is added/deleted/...
I'm lost on how to do this. Passing the arrayList as an array into the Jlistconstructo r will just display the elements, but no updates will be made according to the API.
Apparently ListDataListene rs should be used, and... -
Thank you, I read the javadoc for getPreferredScr ollableViewport Size(), and it helped. I don't have scrollbars but at least my window is visible. Displaying the scrollbars shouldn't be difficult.Leave a comment:
-
Swing Jlist LayoutOrientation Problem
Hi all,
I've bumped into an odd problem creating a GUI in swing. As you will see in the screenshots, I have a tabbed layout. Each tab is a Jpanel. On this panel I have put a JList, containing a series of objects. My intention is to have a single column of objects in the list, and have it to scroll when the objects exceed the vertical space.
My code is this:
[CODE=java]private JComponent createListBox()... -
-
Jscrollpane; update scrollbars
I have a Jscrollpane, holding a Jpanel on which I draw. Now, I have made buttons to zoom in and out. They will simply change the value of variables that hold the size of my Jpanel and the drawing on my Jpanel, and then resize the panel and redraw.
When I zoom in, the scrollbars don't update itself, unless I grab a border of my Jframe, and resize the window. How do I get the scrollbars of the Jscrollpane to update? -
I solved my problem, or at least found what is wrong. The folder I load/save to is on an ext3 - filesystem. I saved I file and loaded it from a NTFS - filesystem, and things worked like before.
I do think it's kinda strange since vb.net shouldn't be aware of the kind of filesystem..the os should manage that....Leave a comment:
-
yes, my system is sufficient by far.
I have installed .net framework 3.5 SP1, problem persisted.
and I'm sure the setups are not corrupted since I used the dvd numerous times before....Leave a comment:
-
it stalls right after when i save a project i newly created and worked on, or right after opening a project.
so it does load/save the file, but then goes unresponsive....Leave a comment:
-
Apparently the same goes for visual C# 2008 express.
Please, I could use the help.Leave a comment:
No activity results to display
Show More
Leave a comment: