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


C++ PointObject类代码示例

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


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

示例1: create

 static PointObject * create(Vec2 ratio, Vec2 offset)
 {
     PointObject *ret = new (std::nothrow) PointObject();
     ret->initWithPoint(ratio, offset);
     ret->autorelease();
     return ret;
 }
开发者ID:zengzhining,项目名称:cocos2d-x,代码行数:7,代码来源:CCParallaxNode.cpp

示例2: create

 static PointObject * create(const Vec2& ratio, const Vec2& offset, const Vec2& autoscroll)
 {
     PointObject *ret = new PointObject();
     ret->initWithPoint(ratio, offset, autoscroll);
     ret->autorelease();
     return ret;
 }
开发者ID:Ratel13,项目名称:avalon,代码行数:7,代码来源:ParallaxContainer.cpp

示例3: create

	static PointObject * create(Point ratio, Point offset)
	{
		PointObject *ret = new PointObject();
		ret->initWithPoint(ratio, offset);
		ret->autorelease();
		return ret;
	}
开发者ID:hpimentel,项目名称:Cocos2dxAndroidTutorial,代码行数:7,代码来源:CCParallaxNodeExtras.cpp

示例4: DoRecursion

void Voxelify::DoRecursion(BaseObject *op, BaseObject *child, GeDynamicArray<Vector> &points, Matrix ml) {
	BaseObject *tp;
	if (child){
		tp = child->GetDeformCache();
		ml = ml * child->GetMl();
		if (tp){
			DoRecursion(op,tp,points,ml);
		}
		else{
			tp = child->GetCache(NULL);
			if (tp){
				DoRecursion(op,tp,points,ml);
			}
			else{
				if (!child->GetBit(BIT_CONTROLOBJECT)){
					if (child->IsInstanceOf(Opoint)){
						PointObject * pChild = ToPoint(child);
						LONG pcnt = pChild->GetPointCount();
						const Vector *childVerts = pChild->GetPointR();
						for(LONG i=0; i < pcnt; i++){
							points.Push(childVerts[i] * ml * parentMatrix);
						}
					}
				}
			}
		}
		for (tp = child->GetDown(); tp; tp=tp->GetNext()){
			DoRecursion(op,tp,points,ml);
		}
	}
}
开发者ID:eighteight,项目名称:Voxelify,代码行数:31,代码来源:voxelify.cpp

示例5: CCASSERT

void ParallaxContainer::addChild(Node *child, int z, const Vec2& ratio, const Vec2& offset, const Vec2& autoScroll)
{
    CCASSERT( child != nullptr, "Argument must be non-nil");
    PointObject *obj = PointObject::create(ratio, offset, autoScroll);
    obj->setChild(child);
    ccArrayAppendObjectWithResize(_parallaxArray, (Ref*)obj);

    Node::addChild(child, z, child->getTag());
}
开发者ID:Ratel13,项目名称:avalon,代码行数:9,代码来源:ParallaxContainer.cpp

示例6: PointObject

PointObject* TemplateTrack::importWaypoint(const MapCoordF& position, const QString& name)
{
	PointObject* point = new PointObject(map->getUndefinedPoint());
	point->setPosition(position);
	point->setTag(QStringLiteral("name"), name);
	map->addObject(point);
	map->addObjectToSelection(point, false);
	return point;
}
开发者ID:02JanDal,项目名称:mapper,代码行数:9,代码来源:template_track.cpp

示例7: incrementOffset

void ParallaxNodeExtras::incrementOffset(Point offset, Node* node){
	for (int i = 0; i < _parallaxArray->num; i++) {
		PointObject *point = (PointObject *)_parallaxArray->arr[i];
		Node * curNode = point->getChild();
		if (curNode==/*->isEqual*/(node)) {
			point->setOffset(point->getOffset() + offset);
			break;
		}
	}
}
开发者ID:hpimentel,项目名称:Cocos2dxAndroidTutorial,代码行数:10,代码来源:CCParallaxNodeExtras.cpp

示例8: removeChild

void ParallaxContainer::removeChild(Node* child, bool cleanup)
{
    for( int i=0;i < _parallaxArray->num;i++) {
        PointObject *point = (PointObject*)_parallaxArray->arr[i];
        if (point->getChild() == child) {
            ccArrayRemoveObjectAtIndex(_parallaxArray, i, true);
            break;
        }
    }
    Node::removeChild(child, cleanup);
}
开发者ID:Ratel13,项目名称:avalon,代码行数:11,代码来源:ParallaxContainer.cpp

示例9: CCASSERT

void ParallaxNode::addChild(Node *child, int z, const Vec2& ratio, const Vec2& offset)
{
    CCASSERT( child != nullptr, "Argument must be non-nil");
    PointObject *obj = PointObject::create(ratio, offset);
    obj->setChild(child);
    ccArrayAppendObjectWithResize(_parallaxArray, (Ref*)obj);

    Vec2 pos = this->absolutePosition();
    pos.x = -pos.x + pos.x * ratio.x + offset.x;
    pos.y = -pos.y + pos.y * ratio.y + offset.y;
    child->setPosition(pos);

    Node::addChild(child, z, child->getName());
}
开发者ID:zengzhining,项目名称:cocos2d-x,代码行数:14,代码来源:CCParallaxNode.cpp

示例10: updateHFOVRect

void GraphicalRobotElement::updateHFOVRect() {
	QPolygonF poly;

	if (this->currentWIM.has_myposition() ) {
		for (int i = 0; i < currentObsm.view_limit_points_size(); i++) {
			const PointObject p = currentObsm.view_limit_points (i);
			QLineF l = this->parentScene->lineFromFCA (
			               this->currentWIM.myposition().x() * 1000,
			               this->currentWIM.myposition().y() * 1000,
			               this->currentWIM.myposition().phi() + p.bearing(),
			               p.distance() * 1000);
			poly << l.p2();
			HFOVLines->setPolygon (poly);
		}
	} else {
		HFOVLines->setPolygon (QPolygon() );
	}
}
开发者ID:,项目名称:,代码行数:18,代码来源:

示例11: visit

/*
The positions are updated at visit because:
- using a timer is not guaranteed that it will called after all the positions were updated
- overriding "draw" will only precise if the children have a z > 0
*/
void ParallaxNode::visit(Renderer *renderer, const Mat4 &parentTransform, uint32_t parentFlags)
{
    //    Vec2 pos = position_;
    //    Vec2    pos = [self convertToWorldSpace:Vec2::ZERO];
    Vec2 pos = this->absolutePosition();
    if( ! pos.equals(_lastPosition) )
    {
        for( int i=0; i < _parallaxArray->num; i++ ) 
        {
            PointObject *point = (PointObject*)_parallaxArray->arr[i];
            float x = -pos.x + pos.x * point->getRatio().x + point->getOffset().x;
            float y = -pos.y + pos.y * point->getRatio().y + point->getOffset().y;            
            point->getChild()->setPosition(x,y);
        }
        _lastPosition = pos;
    }
    Node::visit(renderer, parentTransform, parentFlags);
}
开发者ID:zengzhining,项目名称:cocos2d-x,代码行数:23,代码来源:CCParallaxNode.cpp

示例12: visit

void ParallaxContainer::visit(cocos2d::Renderer *renderer, const cocos2d::Mat4& parentTransform, uint32_t parentFlags)
{
    Vec2 pos = parallaxPosition;

    //if (!pos.equals(_lastPosition)) {
        for( int i=0; i < _parallaxArray->num; i++ ) {
            PointObject *point = (PointObject*)_parallaxArray->arr[i];

            // auto scrolling
            auto offset = point->getOffset();
            offset.x += point->getAutoscroll().x;
            offset.y += point->getAutoscroll().y;
            point->setOffset(offset);

            float x = pos.x * point->getRatio().x + point->getOffset().x;
            float y = pos.y * point->getRatio().y + point->getOffset().y;
            point->getChild()->setPosition({x, y});
        }
        _lastPosition = pos;
    //}
    Node::visit(renderer, parentTransform, parentFlags);
}
开发者ID:Ratel13,项目名称:avalon,代码行数:22,代码来源:ParallaxContainer.cpp

示例13: deepCopy

/*===========================================================================*/
void PointObject::deepCopy( const PointObject& other )
{
    BaseClass::deepCopy( other );
    m_sizes = other.sizes().clone();
}
开发者ID:naohisas,项目名称:KVS,代码行数:6,代码来源:PointObject.cpp

示例14: add

/*===========================================================================*/
void PointObject::add( const PointObject& other )
{
    if ( this->coords().size() == 0 )
    {
        // Copy the object.
        BaseClass::setCoords( other.coords() );
        BaseClass::setNormals( other.normals() );
        BaseClass::setColors( other.colors() );
        this->setSizes( other.sizes() );

        BaseClass::setMinMaxObjectCoords(
            other.minObjectCoord(),
            other.maxObjectCoord() );
        BaseClass::setMinMaxExternalCoords(
            other.minExternalCoord(),
            other.maxExternalCoord() );
    }
    else
    {
        if ( !BaseClass::hasMinMaxObjectCoords() )
        {
            BaseClass::updateMinMaxCoords();
        }

        kvs::Vec3 min_object_coord( BaseClass::minObjectCoord() );
        kvs::Vec3 max_object_coord( BaseClass::maxObjectCoord() );

        min_object_coord.x() = kvs::Math::Min( min_object_coord.x(), other.minObjectCoord().x() );
        min_object_coord.y() = kvs::Math::Min( min_object_coord.y(), other.minObjectCoord().y() );
        min_object_coord.z() = kvs::Math::Min( min_object_coord.z(), other.minObjectCoord().z() );

        max_object_coord.x() = kvs::Math::Max( max_object_coord.x(), other.maxObjectCoord().x() );
        max_object_coord.y() = kvs::Math::Max( max_object_coord.y(), other.maxObjectCoord().y() );
        max_object_coord.z() = kvs::Math::Max( max_object_coord.z(), other.maxObjectCoord().z() );

        BaseClass::setMinMaxObjectCoords( min_object_coord, max_object_coord );
        BaseClass::setMinMaxExternalCoords( min_object_coord, max_object_coord );

        // Integrate the coordinate values.
        kvs::ValueArray<kvs::Real32> coords;
        const size_t ncoords = this->coords().size() + other.coords().size();
        coords.allocate( ncoords );
        kvs::Real32* pcoords = coords.data();

        // x,y,z, ... + x,y,z, ... = x,y,z, ... ,x,y,z, ...
        memcpy( pcoords, this->coords().data(), this->coords().byteSize() );
        memcpy( pcoords + this->coords().size(), other.coords().data(), other.coords().byteSize() );
        BaseClass::setCoords( coords );

        // Integrate the normal vectors.
        kvs::ValueArray<kvs::Real32> normals;
        if ( this->normals().size() > 0 )
        {
            if ( other.normals().size() > 0 )
            {
                // nx,ny,nz, ... + nx,ny,nz, ... = nx,ny,nz, ... ,nx,ny,nz, ...
                const size_t nnormals = this->normals().size() + other.normals().size();
                normals.allocate( nnormals );
                kvs::Real32* pnormals = normals.data();
                memcpy( pnormals, this->normals().data(), this->normals().byteSize() );
                memcpy( pnormals + this->normals().size(), other.normals().data(), other.normals().byteSize() );
            }
            else
            {
                // nx,ny,nz, ... + (none) = nx,ny,nz, ... ,0,0,0, ...
                const size_t nnormals = this->normals().size() + other.coords().size();
                normals.allocate( nnormals );
                kvs::Real32* pnormals = normals.data();
                memcpy( pnormals, this->normals().data(), this->normals().byteSize() );
                memset( pnormals + this->normals().size(), 0, other.coords().byteSize() );
            }
        }
        else
        {
            if ( other.normals().size() > 0 )
            {
                const size_t nnormals = this->coords().size() + other.normals().size();
                normals.allocate( nnormals );
                kvs::Real32* pnormals = normals.data();
                // (none) + nx,ny,nz, ... = 0,0,0, ... ,nz,ny,nz, ...
                memset( pnormals, 0, this->coords().byteSize() );
                memcpy( pnormals + this->coords().size(), other.normals().data(), other.normals().byteSize() );
            }
        }
        BaseClass::setNormals( normals );

        // Integrate the color values.
        kvs::ValueArray<kvs::UInt8> colors;
        if ( this->colors().size() > 1 )
        {
            if ( other.colors().size() > 1 )
            {
                // r,g,b, ... + r,g,b, ... = r,g,b, ... ,r,g,b, ...
                const size_t ncolors = this->colors().size() + other.colors().size();
                colors.allocate( ncolors );
                kvs::UInt8* pcolors = colors.data();
                memcpy( pcolors, this->colors().data(), this->colors().byteSize() );
                memcpy( pcolors + this->colors().size(), other.colors().data(), other.colors().byteSize() );
            }
//.........这里部分代码省略.........
开发者ID:naohisas,项目名称:KVS,代码行数:101,代码来源:PointObject.cpp

示例15: perform_virtual

void DeselectAllTool::perform_virtual(Object *o)
{
    PointObject* p = (PointObject*) o;
    p->deselectAllPoints();
}
开发者ID:oVooVo,项目名称:Splines,代码行数:5,代码来源:deselectalltool.cpp


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