Perl 6 - the future is here, just unevenly distributed

IRC log for #openframeworks, 2014-07-12

| Channels | #openframeworks index | Today | | Search | Google Search | Plain-Text | summary

All times shown according to UTC.

Time Nick Message
00:41 jjj__ joined #openframeworks
00:41 jjj__ jjj
00:42 jjj__ r u here
00:42 jjj__ ?
01:09 pizthewiz joined #openframeworks
01:35 pizthewiz joined #openframeworks
01:59 lukaszw joined #openframeworks
02:00 kritzikratzi joined #openframeworks
02:12 booltox joined #openframeworks
02:20 lukaszw joined #openframeworks
02:28 lukaszw joined #openframeworks
02:32 booltox joined #openframeworks
02:35 workergnome joined #openframeworks
03:29 Beliq joined #openframeworks
04:03 booltox joined #openframeworks
04:04 booltox_ joined #openframeworks
04:21 Beliq joined #openframeworks
04:42 Beliq joined #openframeworks
04:53 Beliq joined #openframeworks
05:04 Beliq joined #openframeworks
05:13 vade joined #openframeworks
05:21 Beliq joined #openframeworks
06:01 mhashmi joined #openframeworks
06:19 Beliq joined #openframeworks
06:38 Beliq joined #openframeworks
07:07 jedahan joined #openframeworks
07:53 Beliq joined #openframeworks
07:54 mihi_tr joined #openframeworks
08:24 mhashmi joined #openframeworks
08:40 mhashmi joined #openframeworks
08:50 Beliq joined #openframeworks
09:17 nylki_ joined #openframeworks
09:25 kritzikratzi joined #openframeworks
09:33 mhashmi joined #openframeworks
09:50 Beliq joined #openframeworks
10:03 nylki_ hi there. i have a probably not entirely openframeworks related, but c++ related question. I have an Class "Artefact" i whose objects I have a vector<ofRectangle>. i fill this vector in my update() function with pushback. however, when i want to read out and draw the rectangles from each artefact object, the vector is empty. what might be my problem?
10:05 nylki_ my code: https://gist.github.com/nylki/a0dc415a074b6e65fb25
10:07 nylki_ the second for-loop in draw is not being executed as apparently the size of the vector is 0, although in update in was not.
10:13 nylki joined #openframeworks
10:26 ncls joined #openframeworks
10:43 Beliq hey nylki
10:44 Beliq I do not see how you are suppose to fill up the array
10:45 nylki hey Beliq. see also here: http://forum.openframeworks.cc/t/vector-filled-in-update-gets-empty-in-draw/16412
10:45 nylki a.foundObjects.push_back(r);
10:46 nylki where a is the currently iterated object of vector<Artefact> artefacts, and r is an ofRectangle
10:46 Beliq they way I do it is with pointer in the vector
10:47 Beliq so kind of vector<Artefact*> and then populating it with Artefact[i]-> in the loop which is filling it up
10:48 nylki Beliq: hm ok. might try it. however, i still want to know why it gets empty in the draw() function.
10:48 Beliq because a is empty
10:48 nylki Beliq: it is not. i can read a.name
10:48 nylki in draw
10:49 nylki which is not empty. therefore a is not empty.
10:49 nylki a.foundObjects is empty, but everything else in a is intact.
10:50 Beliq did you try, foundObjects.size ?
10:50 Beliq you have it as variable, I do not see why you need to address the a
10:50 nylki yes. its 0 in draw. in update its usually 1 or 2, depending on situation
10:53 nylki Beliq: what do you mean, i dont have to address the a? i do have several artefact objects, each with own foundObjects vectors. I itereate of the vector<Artefact> where each Artefact shall be named "a" here.
10:56 Beliq well in draw, you use finder.size
10:57 Beliq Sorry about the a...it's still early :D However I do not see obvious reason. Do you get any erros ?
11:01 nylki Beliq: ah that is old. finder.size, copied the wrong part.
11:01 nylki Beliq: no prob. i get no errors. i feel like i am missing something essential, which i dont see right now.
11:03 Beliq Ah
11:04 Beliq Try instead of r in the push_back
11:04 Beliq (new Artefact)
11:08 nylki Beliq: hm not sure what you mean. do you mean a.foundObjects.push_back(new Rectangle); ?
11:09 nylki ofRectangle ofcourse
11:09 Beliq i mean new theClass name
11:10 Beliq nylki something like I mean: http://pastebin.com/WJwdy0JV
11:15 Beliq nylki: Is that helpful ?
11:16 nylki Beliq: i'm trying it out. although i hoped not to use a extra setter method here (which Artefact::addRect()) would be.
11:16 nylki Beliq: thanks so far :)
11:21 nylki i suppose if i put all into my draw() method it'd work fine. but thats not what i want in terms of clean and efficient code.
12:03 nylki reading http://openframeworks.cc/tutorials/c++%20concepts/001_stl_vectors_basic.html "Vectors of objects", so your idea with using a vector of pointer to objects might be really the idea.
12:03 nylki "In many situations this works great and is preferred. However, problems can sometimes arise if the class has member pointers and dynamically allocated memory but not a proper copy constructor. A vector of pointers to objects can be used, although shared pointers are probably best. Shared pointers would also be needed to use polymorphism / base classes."
12:07 Beliq joined #openframeworks
12:07 mihi_tr joined #openframeworks
12:07 ChanServ joined #openframeworks
12:07 keeran joined #openframeworks
12:07 qDot_ joined #openframeworks
12:07 loop_ joined #openframeworks
12:07 oneirona1t joined #openframeworks
12:07 jacres joined #openframeworks
12:07 tapout joined #openframeworks
12:07 davidnunez joined #openframeworks
12:07 evhan55 joined #openframeworks
12:07 _rm joined #openframeworks
12:07 tgfrerer joined #openframeworks
12:07 roxlu joined #openframeworks
12:12 mihi_tr_ joined #openframeworks
12:14 Hurtzy joined #openframeworks
12:46 Hurtzy joined #openframeworks
14:34 jedahan joined #openframeworks
14:36 vade joined #openframeworks
14:46 mhashmi joined #openframeworks
15:16 jedahan joined #openframeworks
15:29 drdanmaku joined #openframeworks
15:49 robot joined #openframeworks
16:42 robot joined #openframeworks
17:02 vade joined #openframeworks
17:04 jedahan joined #openframeworks
18:26 nylki joined #openframeworks
19:10 vade joined #openframeworks
19:15 nylki joined #openframeworks
19:27 jedahan joined #openframeworks
20:07 Beliq joined #openframeworks
20:59 GuidovanPossum joined #openframeworks
21:07 Beliq joined #openframeworks
21:08 jedahan_ joined #openframeworks
21:49 robot joined #openframeworks
22:08 Beliq joined #openframeworks
23:09 Beliq joined #openframeworks
23:11 Beliq joined #openframeworks
23:15 sebllll joined #openframeworks

| Channels | #openframeworks index | Today | | Search | Google Search | Plain-Text | summary