• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ RAMEN_ASSERT函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: normalize

    void normalize()
    {
        T l = length();
        RAMEN_ASSERT( l > T(0));

        x /= l;
        y /= l;
        z /= l;
    }
开发者ID:devernay,项目名称:ramen-1,代码行数:9,代码来源:vector3.hpp


示例2: RAMEN_ASSERT

    vector3_t<T>& operator/=( T s)
    {
        RAMEN_ASSERT( s != T(0));

        x /= s;
        y /= s;
        z /= s;
        return *this;
    }
开发者ID:devernay,项目名称:ramen-1,代码行数:9,代码来源:vector3.hpp


示例3: cu_ctx_destroy

void cu_ctx_destroy( CUcontext ctx)
{
	RAMEN_ASSERT( cuCtxDestroy_);

	// in this case, we don't check for errors, as
	// this is used in a destructor, and there's not much
	// we can do about it anyway.
	cuCtxDestroy_( ctx);
}
开发者ID:JohanAberg,项目名称:Ramen,代码行数:9,代码来源:cuda.cpp


示例4: RAMEN_ASSERT

void graph_t::add_node( node_t *v)
{
	RAMEN_ASSERT( !has_node( v));

	vertex_desc_type vd = boost::add_vertex( graph_);
	graph_[vd].node = v;
	node_to_desc_[v] = vd;
	valid_order_ = false;
}
开发者ID:JohanAberg,项目名称:Ramen,代码行数:9,代码来源:graph.cpp


示例5: RAMEN_ASSERT

void clipboard_t::copy_keys( const std::string& name, const anim::any_curve_ptr_t& c)
{
	RAMEN_ASSERT( copying_);
	
	copy_curves_mode_ = false;
	contents_.push_back( named_curve_type( name, boost::shared_ptr<any_curve_t>()));
	copy_keys_visitor v( contents_.back().second);
	boost::apply_visitor( v, c);
}
开发者ID:JohanAberg,项目名称:Ramen,代码行数:9,代码来源:clipboard.cpp


示例6: RAMEN_ASSERT

void yaml_oarchive_t::write_composition_header()
{
	RAMEN_ASSERT( !header_written_);

	out_ << YAML::Key << "magic"	<< YAML::Value << "Ramen composition";
	out_ << YAML::Key << "version"	<< YAML::Value << version;
	check_errors();
	header_written_ = true;
}
开发者ID:JohanAberg,项目名称:Ramen,代码行数:9,代码来源:yaml_oarchive.cpp


示例7: add_level

	void add_level( const Sampler& sampler)
	{
		RAMEN_ASSERT( has_top_sampler_);

		samplers_.push_back( sampler);

		float scale = scales_.back() * 0.5f;
		scales_.push_back( scale);
		iscales_.push_back( 1.0f / scale);
	}
开发者ID:JohanAberg,项目名称:Ramen,代码行数:10,代码来源:mipmap_sampler.hpp


示例8: set_top_level

	void set_top_level( const TopLevelSampler& sampler)
	{
		RAMEN_ASSERT( !has_top_sampler_);

		top_sampler_ = sampler;
		has_top_sampler_ = true;

		scales_.push_back( 1.0f);
		iscales_.push_back( 1.0f);
	}
开发者ID:JohanAberg,项目名称:Ramen,代码行数:10,代码来源:mipmap_sampler.hpp


示例9: RAMEN_ASSERT

composition_t *param_t::composition()
{
    RAMEN_ASSERT( param_set());
    parameterised_t *p = parameterised();

    if( p)
        return p->composition();
    else
        return 0;
}
开发者ID:devernay,项目名称:ramen-1,代码行数:10,代码来源:param.cpp


示例10: deallocate

    void deallocate( unsigned char *p, std::size_t s)
	{
		if( p == 0)
			return;

		RAMEN_ASSERT( s != 0);

	    boost::lock_guard<boost::recursive_mutex> lock( mutex_);
	    pool_.deallocate( p, s);
	}
开发者ID:devernay,项目名称:ramen-1,代码行数:10,代码来源:pool_allocator.hpp


示例11: RAMEN_ASSERT

T *aligned_ptr( T *p, int alignment)
{
	RAMEN_ASSERT( (( alignment - 1) & alignment) == 0);

    uintptr_t ptr = reinterpret_cast<uintptr_t>( p);
    uintptr_t align = alignment - 1;
    uintptr_t aligned = ( ptr + align + 1) & ~align;

    return reinterpret_cast<unsigned char *>( aligned);
}
开发者ID:JohanAberg,项目名称:Ramen,代码行数:10,代码来源:util.hpp


示例12: manipulator_t

quad_manipulator_t::quad_manipulator_t( float2_param_t *topleft, float2_param_t *topright,
										float2_param_t *botleft, float2_param_t *botright) : manipulator_t()
{
	RAMEN_ASSERT( topleft && topright && botleft && botright);
	topleft_ = topleft;
	topright_ = topright;
	botleft_ = botleft;
	botright_ = botright;
	picked_corner_ = -1;
}
开发者ID:JohanAberg,项目名称:Ramen,代码行数:10,代码来源:quad_manipulator.cpp


示例13: do_mouse_release_event

	virtual void do_mouse_release_event( const ui::mouse_release_event_t& event)
	{
		if( event.dragged)
		{
			RAMEN_ASSERT( drag_axes_ || drag_center_);
			param_->param_set()->end_edit( param_->track_mouse());
		}

		drag_center_ = drag_axes_ = false;
		dragx_ = dragy_ = true;
	}
开发者ID:devernay,项目名称:ramen-1,代码行数:11,代码来源:move2d_node.cpp


示例14: RAMEN_ASSERT

void vertex_t::perspective_divide()
{
	RAMEN_ASSERT( screen.w != 0);

	inv_w = 1.0f / screen.w;
	screen.x *= inv_w;
	screen.y *= inv_w;

	uv.x *= inv_w;
	uv.y *= inv_w;
}
开发者ID:JohanAberg,项目名称:Ramen,代码行数:11,代码来源:vertex.cpp


示例15: sample_level

	pixel_t sample_level( int level, const vector2_t& p) const
	{
		RAMEN_ASSERT( level >= 0 && level < num_levels());

		if( level == 0)
			return top_sampler_( p);

		float s = scales_[level];
		vector2_t q( p.x * s, p.y * s);
		return samplers_[level - 1]( q);
	}
开发者ID:JohanAberg,项目名称:Ramen,代码行数:11,代码来源:mipmap_sampler.hpp


示例16: do_mouse_press_event

	virtual bool do_mouse_press_event( const ui::mouse_press_event_t& event)
	{
		RAMEN_ASSERT( node()->composition());

		drag_center_ = drag_axes_ = false;
		dragx_ = dragy_ = true;

		move2d_node_t::matrix3_type m( param_->matrix_at_frame( node()->composition()->frame(), node()->aspect_ratio()));

	    // adjust for the aspect factor
	    Imath::V2f c = get_absolute_value<Imath::V2f>( param_->center_param());
	    c = c * m;
		c.x *= node()->aspect_ratio();

		switch( manipulators::pick_xy_axes( event.wpos, c, 70 / event.pixel_scale, 70 / event.pixel_scale,
											get_value<float>( param_->rotate_param()),
											event.aspect_ratio / node()->aspect_ratio(), event.pixel_scale))
		{
			case manipulators::axes_center_picked:
			{
				if( event.modifiers & ui::event_t::control_modifier)
					drag_center_ = true;
				else
					drag_axes_ = true;
			}
			return true;

			case manipulators::axes_x_picked:
			{
				dragy_ = false;

				if( event.modifiers & ui::event_t::control_modifier)
					drag_center_ = true;
				else
					drag_axes_ = true;
			}
			return true;

			case manipulators::axes_y_picked:
			{
				dragx_ = false;

				if( event.modifiers & ui::event_t::control_modifier)
					drag_center_ = true;
				else
					drag_axes_ = true;
			}
			return true;

			default:
				return false;
		}
	}
开发者ID:devernay,项目名称:ramen-1,代码行数:53,代码来源:move2d_node.cpp


示例17: RAMEN_ASSERT

void buffer_t::check_area_inside_image( const Imath::Box2i& area) const
{
	#ifndef NDEBUG
        if( !ImathExt::isInside( bounds_, area))
		{
		    // Not OK, print some debug info and exit
		    std::cout << "Trying to access pixels outside buffer\n";
            //std::cout << "Area = " << area << " Bounds = " << bounds_ << "\n";
			RAMEN_ASSERT( 0);
		}
	#endif
}
开发者ID:devernay,项目名称:ramen-1,代码行数:12,代码来源:buffer.cpp


示例18: RAMEN_ASSERT

void keyer3d_node_t::create_cluster_params( int i)
{
	#ifndef NDEBUG
		RAMEN_ASSERT( i < max_clusters);
		
		std::string kcenter( "k0_center");
		std::string ktol( "k0_tol");
		std::string ksoft( "k0_soft");
	
		kcenter[1] = i + '0';
		std::auto_ptr<color_param_t> c( new color_param_t( kcenter));
		c->set_id( kcenter);
		c->set_default_value( Imath::Color4f( 0, 0, 0, 0));
		c->set_is_rgba( false);
		c->set_static( true);
		//c->set_secret( true);
		c->set_enabled( false);
		c->set_can_undo( false);
		c->set_persist( false);
		c->set_include_in_hash( false);		
		kcenter_[i] = c.get();
		add_param( c);
			
		ktol[1] = i + '0';
		std::auto_ptr<float_param_t> f( new float_param_t( ktol));
		f->set_id( ktol);
		f->set_default_value( 0);
		f->set_min( 0);
		f->set_static( true);
		//f->set_secret( true);
		f->set_enabled( false);
		f->set_can_undo( false);
		f->set_persist( false);
		f->set_include_in_hash( false);		
		ktol_[i] = f.get();
		add_param( f);		
	
		ksoft[1] = i + '0';
		f.reset( new float_param_t( ksoft));
		f->set_id( ksoft);
		f->set_default_value( 0);
		f->set_min( 0);
		f->set_static( true);
		//f->set_secret( true);
		f->set_enabled( false);
		f->set_can_undo( false);
		f->set_persist( false);
		f->set_include_in_hash( false);
		ksoft_[i] = f.get();
		add_param( f);
	#endif
}
开发者ID:JohanAberg,项目名称:Ramen,代码行数:52,代码来源:keyer3d_node.cpp


示例19: RAMEN_ASSERT

void image_node_renderer_t::set_context( const context_t& context)
{
	has_context_ = true;
    new_context_ = context;
    n_ = dynamic_cast<image_node_t*>( new_context_.result_node);
    RAMEN_ASSERT( n_);
	n_->release_image();
	
    n_->composition()->set_frame( new_context_.frame);
    depth_first_inputs_search( *n_, boost::bind( &image_node_t::calc_format_fun, _1, new_context_));
    depth_first_inputs_search( *n_, boost::bind( &image_node_t::calc_bounds_fun, _1, new_context_));
    depth_first_inputs_search( *n_, boost::bind( &image_node_t::clear_interest_fun, _1));
}
开发者ID:devernay,项目名称:ramen-1,代码行数:13,代码来源:image_node_renderer.cpp


示例20: RAMEN_ASSERT

bool yaml_iarchive_t::read_composition_header()
{
	RAMEN_ASSERT( version_ == 0);
	RAMEN_ASSERT( !header_read_);

	std::string magic;

	if( !get_optional_value( "magic", magic))
		return false;

	if( magic != "Ramen composition")
		return false;

	if( !get_optional_value( "version", version_))
		return false;

	if( version() < 1)
		return false;

	root().set_version( version());
	header_read_ = true;
	return true;
}
开发者ID:JohanAberg,项目名称:Ramen,代码行数:23,代码来源:yaml_iarchive.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ RAND函数代码示例发布时间:2022-05-30
下一篇:
C++ RAM函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap