cgv
attach_slot.h
1 #pragma once
2 
3 #include "base.h"
4 
5 #include "lib_begin.h"
6 
7 namespace cgv {
8  namespace base {
9 
11 class CGV_API attach_slot
12 {
13 protected:
18 public:
20  attach_slot();
22  void attach(base_ptr attachment_object, void* user_data = 0);
24  void attach(base_ptr attachment_object, int user_data);
26  base_ptr get_attachment() const;
28  void* get_attachement_data() const;
31 };
32 
34 
36 extern CGV_API bool attach(base_ptr slot_object, base_ptr attachment_object, void* user_data = 0);
37 extern CGV_API bool attach(base_ptr slot_object, base_ptr attachment_object, int user_data);
38 
40 
42 extern CGV_API base_ptr get_attachment(base_ptr slot_object);
43 
45 
47 extern CGV_API void* get_attachment_data(base_ptr slot_object);
48 extern CGV_API int get_attachment_data_int(base_ptr slot_object);
49 
50  }
51 }
52 
53 #include <cgv/config/lib_end.h>
cgv::base::attach_slot::attachment
base_ptr attachment
allow to attach some object to group
Definition: attach_slot.h:15
cgv::base::get_attachment
base_ptr get_attachment(base_ptr slot_object)
query the attachment of an attach_slot object.
Definition: attach_slot.cxx:53
cgv::base::get_attachment_data
void * get_attachment_data(base_ptr slot_object)
query the user data of the attachment of an attach_slot object.
Definition: attach_slot.cxx:62
cgv::data::ref_ptr< base, true >
cgv::base::attach_slot
Definition: attach_slot.h:12
cgv::base::attach
bool attach(base_ptr slot_object, base_ptr attachment_object, void *user_data)
function to attach an object to an object of type attach_slot.
Definition: attach_slot.cxx:38
cgv::base::attach_slot::attachment_user_data
void * attachment_user_data
allow to add user data to the attachment
Definition: attach_slot.h:17
cgv::base::attach_slot::get_attachement_data_int
int get_attachement_data_int() const
return current attachment
cgv
the cgv namespace
Definition: vr_calib.cxx:9