H3D.org Forum Index Programming Issues
problem with DeviceLog in C++ | Register To Post |
| Threaded | Newest First | Previous Topic | Next Topic | Bottom |
| Poster | Thread |
|---|---|
| adrian | Posted on: 2012/5/29 15:20 |
Quite a regular ![]() ![]() Joined: 2010/6/16 From: Constanta, Romania Posts: 31 |
problem with DeviceLog in C++ Hy,
Problem with DeviceLog: when I create it inside c++ it doesn't take the parameters i give. Eg:
MFString *urls = new MFString();
it ignores my parameters and takes the default values. How do I fix that ? Tnx |
| Markus | Posted on: 2012/5/30 8:27 |
Webmaster ![]() ![]() Joined: 2006/3/27 From: SenseGraphics Posts: 1902 |
Re: problem with DeviceLog in C++ Hello,
It does not ignore your values. It uses them, then sets to default values. To fix simply call empty constructor then set the value of each field afterward. Like so:
dl = new DeviceLog();
(Of course you can use setValue instead of push_back if you want ). |
| karlu | Posted on: 2012/5/30 10:42 |
Guru ![]() ![]() Joined: 2004/12/2 From: Sweden Posts: 756 |
Re: problem with DeviceLog in C++ I think that SenseGraphics should consider adding some text about the general design principles and design patterns used in H3D API.
The arguments to DeviceLog, like almost all classes in H3D API, are not parameters, but algorithms. You can replace the algorithm for handling the urls, which is MFString per default, with another algorithm that implements the same interface. This might be an implementation of the Strategy pattern.
|
| adrian | Posted on: 2012/5/30 12:28 |
Quite a regular ![]() ![]() Joined: 2010/6/16 From: Constanta, Romania Posts: 31 |
Re: problem with DeviceLog in C++ Yes it worked.
:) tnx Markus |
| Threaded | Newest First | Previous Topic | Next Topic | Top |
| Register To Post | |





