本文整理汇总了C++中ObjectType::become_parent方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectType::become_parent方法的具体用法?C++ ObjectType::become_parent怎么用?C++ ObjectType::become_parent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectType
的用法示例。
在下文中一共展示了ObjectType::become_parent方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Name
dmz::Boolean
dmz::QtPluginCanvasObjectBasic::_find_config_from_type (
Config &local,
ObjectType &objType) {
const String Name (get_plugin_name ());
Boolean found (objType.get_config ().lookup_all_config_merged (Name, local));
if (!found) {
ObjectType currentType (objType);
currentType.become_parent ();
while (currentType && !found) {
if (currentType.get_config ().lookup_all_config_merged (Name, local)) {
found = True;
objType = currentType;
}
currentType.become_parent ();
}
}
return found;
}
示例2: result
dmz::Boolean
dmz::NetModulePacketCodecBasic::register_object (
const Handle ObjectHandle,
const ObjectType &Type,
Marshal &outData) {
Boolean result (False);
_objTable.remove (ObjectHandle);
ObjectType current (Type);
EncodeObjectStruct *eos (0);
do {
eos = _objTypeTable.lookup (current.get_handle ());
current.become_parent ();
} while (current && !eos);
if (ObjectHandle && eos && _objTable.store (ObjectHandle, eos)) {
result = _write_object (ObjectHandle, NetObjectActivate, outData);
}
return result;
}
示例3: current
void
dmz::CyclesPluginWallOSG::_create_object_wall (
const Handle ObjectHandle,
const ObjectType &Type) {
WallStruct *wall (0);
ObjectType current (Type);
while (current && !wall) {
wall = _wallTable.lookup (Type.get_handle ());
Config wallDef;
if (!wall && current.get_config ().lookup_all_config_merged ("wall", wallDef)) {
const Float32 Red (config_to_float32 ("color.r", wallDef, 1.0));
const Float32 Green (config_to_float32 ("color.g", wallDef, 1.0));
const Float32 Blue (config_to_float32 ("color.b", wallDef, 1.0));
const Float32 Alpha (config_to_float32 ("color.a", wallDef, 1.0));
const Float32 Height (config_to_float32 ("height.value", wallDef, 1.0));
const Float32 Offset (config_to_float32 ("offset.value", wallDef, 1.0));
_log.info << " " << Type.get_name () << " wall information." << endl
<< "\t Red : " << Red << endl
<< "\t Green : " << Green << endl
<< "\t Blue : " << Blue << endl
<< "\t Alpha : " << Alpha << endl
<< "\tHeight : " << Height << endl
<< "\tOffset : " << Offset << endl;
wall = new WallStruct (
True,
osg::Vec4 (Red, Green, Blue, Alpha),
Height,
Offset);
if (wall && !_wallTable.store (Type.get_handle (), wall)) {
delete wall; wall = 0;
}
}
else { current.become_parent (); }
}
if (wall && wall->ColorDefined) {
_create_wall (ObjectHandle, *wall);
}
else if (!wall) {
wall = new WallStruct (False, osg::Vec4 (0.0f, 0.0f, 0.0f, 0.0f), 0.0f, 0.0f);
if (wall && !_wallTable.store (Type.get_handle (), wall)) {
delete wall; wall = 0;
}
}
}
示例4: current
dmz::NetModuleLocalDRBasic::ObjectUpdate *
dmz::NetModuleLocalDRBasic::_create_test_from_type (const ObjectType &Type) {
ObjectUpdate *result (0);
ObjectType current (Type);
while (current && !result) {
result = _typeTable.lookup (current.get_handle ());
if (!result) {
result = _baseTable.lookup (current.get_handle ());
if (result) { _typeTable.store (Type.get_handle (), result); }
}
if (!result) {
Config listData;
if (current.get_config ().lookup_all_config (
"net.rule",
listData)) {
_log.info << "Creating network transmission rules for: " << Type.get_name ()
<< endl;
result = _create_update_list (listData);
if (result) {
if (_baseTable.store (current.get_handle (), result)) {
_typeTable.store (Type.get_handle (), result);
}
}
}
else { current.become_parent (); }
}
}
if (!result) {
result = _defaultTest;
if (result) { _typeTable.store (Type.get_handle (), result); }
}
return result;
}
示例5: event
// RenderPluginEventOSG Interface
dmz::RenderPluginEventOSG::TypeStruct *
dmz::RenderPluginEventOSG::_get_type (
const Handle EventHandle,
const EventType &Type) {
TypeStruct *result (0);
EventModule *module = get_event_module ();
TypeTable *table (0);
EventType event (Type);
while (event && !result) {
TypeTable *table = _get_type_table (Type);
if (table) {
ObjectType current;
if (module) {
module->lookup_object_type (EventHandle, table->TypeAttr, current);
}
const ObjectType Start (current);
while (current && !result) {
result = table->map.lookup (current.get_handle ());
if (!result) {
result = _create_type (EventHandle, event, current, *table);
}
if (!result) { current.become_parent (); }
}
if (result && (current != Start)) {
table->map.store (Start.get_handle (), result);
}
}
if (!result) { event.become_parent (); }
}
return result;
}
示例6: current
// Object Observer Interface
void
dmz::RenderPluginDisableObjectIsect::create_object (
const UUID &Identity,
const Handle ObjectHandle,
const ObjectType &Type,
const ObjectLocalityEnum Locality) {
if (_isect) {
Boolean *value (0);
ObjectType current (Type);
while (current && !value) {
value = _isectTable.lookup (current.get_handle ());
if (!value) {
Config data;
if (current.get_config ().lookup_config ("render.isect", data)) {
Boolean disable = config_to_boolean ("disable", data, False);
value = new Boolean (disable);
if (!_isectTable.store (current.get_handle () , value)) {
delete value; value = 0;
}
}
}
current.become_parent ();
}
if (value && *value) {
if (_isect->disable_isect (ObjectHandle) == 0) {
*value = False;
_log.error << "Unable to disable intersection for type: " << Type.get_name ()
<< endl;
}
}
}
}
示例7: current
dmz::AudioPluginObject::SoundDefStruct *
dmz::AudioPluginObject::_get_sound_list (const ObjectType &Type) {
ObjectType current (Type);
SoundDefStruct *result (0);
while (!result && current) {
result = _soundTable.lookup (current.get_handle ());
if (!result) {
result = _object_type_to_sound_list (current);
}
current.become_parent ();
}
return result;
}
示例8: current
dmz::RenderPluginObjectOSG::DefStruct *
dmz::RenderPluginObjectOSG::_lookup_def_struct (const ObjectType &Type) {
ObjectType current (Type);
DefStruct *result (0);
while (!result && current) {
result = _typeTable.lookup (current.get_handle ());
if (!result) {
result = _create_def_struct (current);
if (result) { _typeTable.store (Type.get_handle (), result); }
else { current.become_parent (); }
}
}
return result;
}
示例9: test
//.........这里部分代码省略.........
!newTestObject.is_of_exact_type (anotherCat) &&
newTestObject.is_of_exact_type (anotherCaracal));
// test set_type
ObjectType anotherTestObject;
test.validate (
"test set_type (Name, context)",
newTestObject.set_type (CatName, context) &&
newTestObject.is_of_type (anotherCat) &&
newTestObject.is_of_exact_type (anotherCat));
anotherTestObject = shouldBeNothing;
test.validate (
"test set_type (Handle, context)",
newTestObject.set_type (anotherCaracal.get_handle (), context) &&
newTestObject.is_of_type (anotherCaracal) &&
newTestObject.is_of_exact_type (anotherCaracal));
test.validate (
"test get_name",
(newTestObject.get_name () == CaracalName));
test.validate (
"test get_handle",
(newTestObject.get_handle () == anotherCaracal.get_handle ()));
// get / become parent
ObjectType newKitty (CaracalName, context);
test.validate (
"test get_parent",
newKitty.get_parent () == anotherCat);
test.validate (
"test become_parent",
(newKitty == anotherCaracal) &&
newKitty.become_parent () &&
(newKitty == anotherCat));
// </validate accessor functions>
// ============================================================================ //
// <validate lookup functions>
String data;
anotherCaracal.get_config ().lookup_attribute ("info.texture", data);
test.validate (
"test lookup_attribute",
!data);
String data2, data3;
Config returnCaracalData;
test.validate (
"test lookup_config",
anotherCaracal.get_config ().lookup_all_config_merged ("info", returnCaracalData));
test.validate (
"test lookup_config->lookup_attribute -- success",
returnCaracalData.lookup_attribute ("ears", data2) &&
data2 == "awesome");
test.validate (
"test lookup_config->lookup_attribute -- failure",
!returnCaracalData.lookup_attribute ("howTo", data3) &&
!data3);
// test.log.out << "M: <" << data2 << ">" << endl;
// test.log.out << "M: <" << data3 << ">" << endl;
test.validate (