当前位置: 首页>>代码示例>>C++>>正文


C++ AbstractObject类代码示例

本文整理汇总了C++中AbstractObject的典型用法代码示例。如果您正苦于以下问题:C++ AbstractObject类的具体用法?C++ AbstractObject怎么用?C++ AbstractObject使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AbstractObject类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: NewObjectArray

LObject NewObjectArray(jsize length,const AbstractObject& elementClass,const AbstractObject& initialElement) {
    jclass jElementClass=(jclass)elementClass.GetJObject();
    jobject jInitialElement=initialElement.GetJObject();
    jobject array=GetEnv()->NewObjectArray(length,jElementClass,jInitialElement);
    TranslateJavaException();
    return LObject::WrapLocal(array);
}
开发者ID:DmitrySkiba,项目名称:itoa-jnipp,代码行数:7,代码来源:JavaNI.cpp

示例2: DEBUG5

AbstractObjectPtr
ObjectFactory::createObject(
    const QString &aName,
    const Position aPosition,
    const qreal aWidth,
    const qreal anHeight)
{
    const ObjectFactory *myFactoryPtr = theFactoryListPtr->getFactoryPtr(aName);
    DEBUG5("ObjectFactory::createObject(\"%s\") Factory=%p", ASCII(aName), myFactoryPtr);
    if (myFactoryPtr == nullptr) {
        DEBUG1("There is no factory for Object type '%s'", ASCII(aName));
        return nullptr;
    }
    AbstractObject *myObjectPtr = myFactoryPtr->createObject();
    assert (myObjectPtr != nullptr);
    AbstractObjectPtr mySharedOPtr = AbstractObjectPtr(myObjectPtr);
    myObjectPtr->theThisPtr = mySharedOPtr;
    DEBUG5("  object created = %p, i18n name = '%s'", myObjectPtr, ASCII(myObjectPtr->getName()));
    assert (aName.contains(" ") == false);
    myObjectPtr->theInternalName = aName;
    myObjectPtr->theCenter = aPosition;
    if (aWidth != 1.0)
        myObjectPtr->theWidth = aWidth;
    if (anHeight != 1.0)
        myObjectPtr->theHeight = anHeight;
    // finally, get rid of the actual pointer and return the shared_ptr
    assert (nullptr != mySharedOPtr);
    return mySharedOPtr;
}
开发者ID:the-butterfly-effect,项目名称:tbe,代码行数:29,代码来源:ObjectFactory.cpp

示例3:

void DDEngine::SceneTransformator::setObjects(const std::vector<AbstractObject*> objects)
{
	SceneTransformatorStatic::objects = objects;

	for (size_t i = 0; i < objects.size(); i++) {
		AbstractObject* o = objects[i];
		Picker item;
		item.index = i;
		item.name = o->getName();
		selections.push_back(item);
	}

}
开发者ID:Toby91,项目名称:DDEngine,代码行数:13,代码来源:SceneTransformator.cpp

示例4: AbstractObject

void ObjectPool::pushObj(QString objID, QStringList objLinks, QStringList props,QStringList type)
{
    AbstractObject *obj = new AbstractObject(objID);

    for (QString s : props)
    {
      obj->addProp(s);
    }
    obj -> addStrLink(objLinks); // тексто-ссылки на др. объекты.
    obj -> addLinksType(type);
    this -> pool.push_back(obj);

}
开发者ID:Hopetorture,项目名称:ProductionSystem,代码行数:13,代码来源:objectpool.cpp

示例5:

// ------------------------------------
std::vector<AbstractObject* > DumbObjectHandler::GetCollidableObjects()
// ------------------------------------
{
	std::vector<AbstractObject* > objs;
	std::vector<AbstractObject* >::iterator it;
	for (it = m_objects.begin(); it != m_objects.end(); it++)
	{
		AbstractObject* obj = *it;
		if (obj->RespondsTo(EMSG_COLLISION))
			objs.push_back(obj);
	}
	
	return objs;
}
开发者ID:cliclcly,项目名称:oxalo,代码行数:15,代码来源:eObjectHandler.cpp

示例6: Throw

void Throw(const AbstractObject& throwable) {
    jthrowable jThrowable=(jthrowable)throwable.GetJObject();
    int error=GetEnv()->Throw(jThrowable);
    if (error) {
        FatalError("Throw() failed with %d error.",error);
    }
}
开发者ID:DmitrySkiba,项目名称:itoa-jnipp,代码行数:7,代码来源:JavaNI.cpp

示例7: ReleaseBoolArrayElements

void ReleaseBoolArrayElements(const AbstractObject& array,bool* elements,jint mode) {
    jbooleanArray jArray=(jbooleanArray)array.GetJObject();
    if (JBooleanIsBool) {
        GetEnv()->ReleaseBooleanArrayElements(jArray,(jboolean*)elements,mode);
    } else {
        FatalError("jni::ReleaseBoolArrayElements is not implemented yet.");
    }
}
开发者ID:DmitrySkiba,项目名称:itoa-jnipp,代码行数:8,代码来源:JavaNI.cpp

示例8: SetBoolArrayRegion

void SetBoolArrayRegion(const AbstractObject& array,jsize start,jsize length,const bool* buffer) {
    jbooleanArray jArray=(jbooleanArray)array.GetJObject();
    if (JBooleanIsBool) {
        GetEnv()->SetBooleanArrayRegion(jArray,start,length,(const jboolean*)buffer);
    } else {
        FatalError("jni::SetBoolArrayRegion is not implemented yet.");
    }
}
开发者ID:DmitrySkiba,项目名称:itoa-jnipp,代码行数:8,代码来源:JavaNI.cpp

示例9: updateSelection

void DDEngine::SceneTransformatorStatic::selectObject(const int index)
{
	SceneTransformatorStatic::selectedObject = index;
	updateSelection(index);
	AbstractObject* o = objects.at(index);

	XMVECTOR rotationQuat;
	XMVECTOR scaleVec;
	XMVECTOR translateVec;

	XMMatrixDecompose(&scaleVec, &rotationQuat, &translateVec, o->getWorldMatrix());

	XMStoreFloat4(&rotationQuaternions, rotationQuat);
	XMStoreFloat4(&scaleVector, scaleVec);
	XMStoreFloat3(&translationVector, translateVec);

	scaleVector.w = 0.0f;
}
开发者ID:Toby91,项目名称:DDEngine,代码行数:18,代码来源:SceneTransformator.cpp

示例10: MatrixTransform

AbstractObject::AbstractObject(const AbstractObject& ao,const CopyOp& copyop) :
MatrixTransform(ao,copyop) {
	AbstractObjectParams aop;
	ao.getParams(aop);
	setParams(aop);
	m_bIsTargetPick = ao.m_bIsTargetPick;

	s_nAbstractObjectNo += 1;
}
开发者ID:octaviansoldea,项目名称:VRShop,代码行数:9,代码来源:VRAbstractObject.cpp

示例11: set

	void Attribute::set(void* owner, AbstractObject o) const{
		if(!extension->mutator){
			Byte* adress = (Byte*)owner + offset;
			//ASSERT(o.getDescriptor() == descriptor);
			descriptor->copy(o.getAdress(),adress);
		}
		else{
			std::vector<AbstractObject> s;
			s.push_back(o);
			extension->mutator->execute(owner,s);
		}
	}
开发者ID:dennisscully,项目名称:Cheezy,代码行数:12,代码来源:Attribute.cpp

示例12: CreateObject

AbstractObject* ObjectFactory::CreateObject (ObjectParameters parameters)
{
	AbstractObject* newObject = nullptr;

	switch (parameters._objectType)
	{
	case SHIP  : newObject = new Ship  ; break;
	case PLANET: newObject = new Planet; break;

	default  : newObject = nullptr;
	}

	ObjectInfo* objectInfo = APPLICATION->_manager->objectManager. Get(parameters._mainParametersPath);

	Model*           model = APPLICATION->_manager->modelManager.  Get (objectInfo->_modelPath);
	GLuint         texture = APPLICATION->_manager->textureManager.Get (objectInfo->_texturePath);
	ShaderProg* shaderProg = APPLICATION->_manager->shaderManager. Get (objectInfo->_shaderPaths);

	newObject->SetModel      (model     );
	newObject->SetTexture    (texture   );
	newObject->SetShaderProg (shaderProg);

	newObject->SetWorldPos   (parameters._worldPos);
	newObject->SetScale      (parameters._scale);

	return newObject;
}
开发者ID:Jenkslex,项目名称:Out-of-space,代码行数:27,代码来源:ObjectFactory.cpp

示例13: XMMatrixRotationQuaternion

void DDEngine::SceneTransformator::transform(const DDERenderPackage pkg)
{
	if (selectedObject > -1 && enableTransformFlag) {

		AbstractObject* o = objects.at(selectedObject);

		XMMATRIX rot = XMMatrixRotationQuaternion(DirectX::XMLoadFloat4(&rotationQuaternions));
		XMMATRIX scale = XMMatrixScalingFromVector(DirectX::XMLoadFloat4(&scaleVector));
		XMMATRIX translation = XMMatrixTranslationFromVector(DirectX::XMLoadFloat3(&translationVector));

		XMFLOAT4X4 rotMat;
		XMFLOAT4X4 scaleMat;
		XMFLOAT4X4 transMat;

		DirectX::XMStoreFloat4x4(&rotMat, rot);
		DirectX::XMStoreFloat4x4(&scaleMat, scale);
		DirectX::XMStoreFloat4x4(&transMat, translation);

		o->setRotationMatrix(rotMat);
		o->setScaleMatrix(scaleMat);
		o->setTranslationMatrix(transMat);
	}
}
开发者ID:Toby91,项目名称:DDEngine,代码行数:23,代码来源:SceneTransformator.cpp

示例14: test_join_meet

void test_join_meet(const AbstractObject& foo,
                    const AbstractObject& bar,
                    const AbstractObject& generic) {
  EXPECT_TRUE(generic.leq(generic));
  EXPECT_FALSE(generic.leq(foo));
  EXPECT_FALSE(generic.leq(bar));
  EXPECT_TRUE(foo.leq(generic));
  EXPECT_TRUE(foo.leq(foo));
  EXPECT_FALSE(foo.leq(bar));
  EXPECT_TRUE(bar.leq(generic));
  EXPECT_FALSE(bar.leq(foo));
  EXPECT_TRUE(bar.leq(bar));

  auto join_with_foo = [&foo](auto&& obj) { return obj.join_with(foo); };
  auto join_with_bar = [&bar](auto&& obj) { return obj.join_with(bar); };
  auto join_with_generic = [&generic](auto&& obj) {
    return obj.join_with(generic);
  };
  test_operation(generic, join_with_generic, generic);
  test_operation(generic, join_with_foo, generic);
  test_operation(generic, join_with_bar, generic);
  test_operation(foo, join_with_generic, generic);
  test_operation(foo, join_with_foo, foo);
  test_operation(foo, join_with_bar, generic);
  test_operation(bar, join_with_generic, generic);
  test_operation(bar, join_with_foo, generic);
  test_operation(bar, join_with_bar, bar);

  auto meet_with_foo = [&foo](auto&& obj) { return obj.meet_with(foo); };
  auto meet_with_bar = [&bar](auto&& obj) { return obj.meet_with(bar); };
  auto meet_with_generic = [&generic](auto&& obj) {
    return obj.meet_with(generic);
  };
  test_operation(generic, meet_with_generic, generic);
  test_operation(generic, meet_with_foo, foo);
  test_operation(generic, meet_with_bar, bar);
  test_operation(foo, meet_with_generic, foo);
  test_operation(foo, meet_with_foo, foo);
  test_operation(bar, meet_with_generic, bar);
  test_operation(bar, meet_with_bar, bar);
  auto foo_copy = foo;
  EXPECT_EQ(foo_copy.meet_with(bar), sparta::AbstractValueKind::Bottom);
  auto bar_copy = bar;
  EXPECT_EQ(bar_copy.meet_with(foo), sparta::AbstractValueKind::Bottom);
}
开发者ID:JoelMarcey,项目名称:redex,代码行数:45,代码来源:ReflectionAnalysisTestVerify.cpp

示例15: IsAssignableFrom

bool IsAssignableFrom(const AbstractObject& clazz,const AbstractObject& clazzFrom) {
    jclass jClazz=(jclass)clazz.GetJObject();
    jclass jClazzFrom=(jclass)clazzFrom.GetJObject();
    return GetEnv()->IsAssignableFrom(jClazz,jClazzFrom)==JNI_TRUE;
}
开发者ID:DmitrySkiba,项目名称:itoa-jnipp,代码行数:5,代码来源:JavaNI.cpp


注:本文中的AbstractObject类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。