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


C++ CBox类代码示例

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


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

示例1: Enable

void CLuaGroup::AddLuaWidget(CLuaWidget *w)
{
    if (m_bInitEnable)
    {
        m_bInitEnable = false;
        Enable(true);
    }
    
    // Update each widget's max size, this is necessary before adding new widget because they
    // may request too much width
    const TWidgetList &list = GetWidgetList();
    const int size = SafeConvert<int>(list.size()) + 1; // +1 because new widget is not added yet
    const int maxwidgetsw = NNCurses::GetMaxWidth() - 6;
    const int maxwidth = (maxwidgetsw - (LuaWidgetSpacing() * (size-1))) / size;
    for (TWidgetList::const_iterator it=list.begin(); it!=list.end(); it++)
    {
        CLuaWidget *luaw = dynamic_cast<CLuaWidget *>(*it);
        if (luaw)
            luaw->SetMaxWidth(maxwidth);
    }

    CBox *box = new CBox(VERTICAL, false);
    box->StartPack(w, true, false, 0, 0);
    w->SetMaxWidth(maxwidth);

    StartPack(box, true, true, 0, 0);
}
开发者ID:BackupTheBerlios,项目名称:nixstaller-svn,代码行数:27,代码来源:luagroup.cpp

示例2: GetAnimHierarchyFromSkinClump

void CPedModelInfo::CreateHitColModelSkinned(RpClump* clump)
{
	RpHAnimHierarchy* hier = GetAnimHierarchyFromSkinClump(clump);
	CColModel* hitColModel = new CColModel;
	RwMatrixTag* frameInverseMat = CGame::GetWorkingMatrix1();
	RwMatrixTag* transformMatrix = CGame::GetWorkingMatrix2();
	hitColModel->AllocateData(12, 0, 0, 0, 0, 0);
	RwMatrixInvert(frameInverseMat, &RpClumpGetFrame(clump)->modelling);
	for (size_t i = 0; i < ELEMS_COUNT(m_pColNodeInfos); i++)
	{
		CColSphere colSphere;
		colSphere.Set(m_pColNodeInfos[i].sphere.GetRadius(), m_pColNodeInfos[i].sphere.GetCenter());
		CCollisionData* colData = hitColModel->GetColData();
		*transformMatrix = *frameInverseMat;
		RwInt32 matIndex = RpHAnimIDGetIndex(hier, m_pColNodeInfos[i].animId) << 6;
		RwMatrix* mat = (RwMatrix*)(RpHAnimHierarchyGetMatrixArray(hier) + matIndex);
		RwMatrixTransform((RwMatrix *)transformMatrix, mat, rwCOMBINEPRECONCAT);
		RwV3dTransformPoints(&colSphere.center, &colSphere.center, 1, (RwMatrix *)transformMatrix);
		colSphere.SetSurfaceTypeA(EColSurface::PED);
		colSphere.SetSurfaceTypeB(m_pColNodeInfos[i].surfaceTypeB);
		colData->SetSphere(i, colSphere);
	}
	CBoundingBox boundingBox;
	CVector maxbb(0.5f, 0.5f, 1.2f);
	CVector minbb(-0.5f,-0.5f,-1.2f);
	CBox box;
	box.Set(minbb, maxbb);
	boundingBox.SetBoundingSphere(CSphere(0, 0, 0, 1.5f));
	hitColModel->SetBoundingBox(boundingBox);
	hitColModel->SetColNum(0);
	m_hitColModel = hitColModel;
}
开发者ID:WLSF,项目名称:GTASA,代码行数:32,代码来源:CPedModelInfo.cpp

示例3: String

String^ CommandLine::Text::get()
{
	CBox box;
	while(box(Info.PanelControl(INVALID_HANDLE_VALUE, FCTL_GETCMDLINE, box.Size(), box))) {}
	
	return gcnew String(box);
}
开发者ID:GitMeLyK,项目名称:FarNet,代码行数:7,代码来源:CommandLine.cpp

示例4: CBox

CBox * CBox::create() {
    CBox * pRet = NEW CBox();
    if (pRet) {
        pRet->autorelease();
        return pRet;
    }
    CC_SAFE_DELETE(pRet);
    return NULL;
}
开发者ID:joyfish,项目名称:PlaneWar,代码行数:9,代码来源:CBox.cpp

示例5: Run

	void Run()
	{
		CBox box;
		sketch_for_tools->GetBox(box);
		double centre[3];
		box.Centre(centre);		

		wxGetApp().m_digitizing->digitized_point = DigitizedPoint(gp_Pnt(box.MinX(), centre[1], centre[2]), DigitizeInputType);
		Drawing *pDrawingMode = dynamic_cast<Drawing *>(wxGetApp().input_mode_object);
		if (pDrawingMode != NULL)
		{
			pDrawingMode->AddPoint();
		}
	}
开发者ID:CarlosGS,项目名称:heekscad,代码行数:14,代码来源:Sketch.cpp

示例6: CBox

void CButtonBar::PushLabel(const std::string &n, const std::string &d)
{
    CBox *lbox = new CBox(HORIZONTAL, false);
    
    CLabel *label = new CLabel(n + ": ");
    label->SetDFColors(GetFColors());
    lbox->StartPack(label, false, false, 0, 0);
    
    label = new CLabel(d);
    label->SetDFColors(GetDFColors());
    lbox->StartPack(label, false, false, 0, 0);

    m_pCurBox->StartPack(lbox, true, false, 0, 0);
}
开发者ID:BackupTheBerlios,项目名称:nixstaller-svn,代码行数:14,代码来源:buttonbar.cpp

示例7: GetGridBox

void GetGridBox(const CViewPoint *view_point, CBox &ext){
	gp_Pnt sp[4];
	double zval = 0.5;
	wxSize size = wxGetApp().m_current_viewport->GetViewportSize();
	sp[0] = gp_Pnt(0, 0, zval);
	sp[1] = gp_Pnt(size.GetWidth(), 0, zval);
	sp[2] = gp_Pnt(size.GetWidth(), size.GetHeight(), zval);
	sp[3] = gp_Pnt(0, size.GetHeight(), zval);
	gp_Vec vx, vy;
	view_point->GetTwoAxes(vx, vy, false, 0);
	gp_Pnt datum(0, 0, 0);
	gp_Trsf orimat = wxGetApp().GetDrawMatrix(false);
	datum.Transform(orimat);
	orimat = make_matrix(datum, vx, vy);
	gp_Pln plane(datum, gp_Vec(0, 0, 1).Transformed(orimat));
	{
		for(int i =0; i<4; i++){
			gp_Pnt p1 = view_point->glUnproject(sp[i]);
			sp[i].SetZ(0);
			gp_Pnt p2 = view_point->glUnproject(sp[i]);
			gp_Lin line = make_line(p1, p2);
			gp_Pnt pnt;
			if(intersect(line, plane, pnt))
			{
				ext.Insert(pnt.X(), pnt.Y(), pnt.Z());
			}
		}
	}
}
开发者ID:DavidNicholls,项目名称:heekscad,代码行数:29,代码来源:Grid.cpp

示例8: main

int main()
{
    CBox smallBox(4.0, 2.0, 1.0);
    CBox mediumBox(10.0, 4.0, 2.0);
    CBox aBox;
    CBox bBox;

    aBox = smallBox + mediumBox;
    cout << "aBox dimensions are ";
    aBox.ShowBox();

    bBox = aBox + smallBox + mediumBox;
    cout << "bBox dimensions are ";
    bBox.ShowBox();

    return 0;
}
开发者ID:timkingh,项目名称:CPP_Learning,代码行数:17,代码来源:Ex8_06.cpp

示例9: WriteSolids

static void	WriteSolids(std::wofstream &ofs)
{

	std::set<int> stock_ids;
	wxGetApp().m_program->Stocks()->GetSolidIds(stock_ids);
	for(std::set<int>::iterator It = stock_ids.begin(); It != stock_ids.end(); It++)
	{
		int id = *It;
		HeeksObj* object = wxGetApp().GetIDObject(SolidType, id);
		if(object)
		{
			CBox box;
			object->GetBox(box);
			ofs<<"voxelcut.set_current_color("<<object->GetColor()->COLORREF_color()<<")\n";
			double c[3];
			box.Centre(c);
			ofs<<"toolpath.coords.add_block("<<c[0]<<", "<<c[1]<<", "<<box.MinZ()<<", "<<box.Width()<<", "<<box.Height()<<", "<<box.Depth()<<")\n";
		}
	}
}
开发者ID:play113,项目名称:swer,代码行数:20,代码来源:Simulate.cpp

示例10: GetBox

void HRuler::GetBox(CBox &box)
{
	gp_Pnt point[4];
	GetFourCorners(point);

	for(int i = 0; i<4; i++)
	{
		point[i].Transform(m_trsf);
		box.Insert(point[i].X(), point[i].Y(), point[i].Z());
	}
}
开发者ID:Blokkendoos,项目名称:heekscad,代码行数:11,代码来源:Ruler.cpp

示例11: GetBox

void CEdge::GetBox(CBox &box){
	// just use the vertices for speed
	for (TopExp_Explorer expVertex(m_topods_edge, TopAbs_VERTEX); expVertex.More(); expVertex.Next())
	{
		const TopoDS_Shape &V = expVertex.Current();
		gp_Pnt pos = BRep_Tool::Pnt(TopoDS::Vertex(V));
		double p[3];
		extract(pos, p);
		box.Insert(p);
	}
}
开发者ID:Heeks,项目名称:heekscad,代码行数:11,代码来源:Edge.cpp

示例12: GetBox

void CShape::GetBox(CBox &box)
{
	if(!m_box.m_valid)
	{
		if(m_faces == NULL)create_faces_and_edges();
		BRepTools::Clean(m_shape);
		BRepMesh::Mesh(m_shape, 1.0);
		if(m_faces)m_faces->GetBox(m_box);
	}

	box.Insert(m_box);
}
开发者ID:JonasThomas,项目名称:heekscad,代码行数:12,代码来源:Shape.cpp

示例13:

const bool	CBox::Contains(const CBox& Box) const {
    return Box.GetXLower() >= this->GetXLower() &&
           Box.GetXHigher() <= this->GetXHigher() &&
           Box.GetYLower() >= this->GetYLower() &&
           Box.GetYHigher() <= this->GetYHigher() &&
           Box.GetZLower() >= this->GetZLower() &&
           Box.GetZHigher() <= this->GetZHigher();
}
开发者ID:,项目名称:,代码行数:8,代码来源:

示例14: GetBox

void HGear::GetBox(CBox &box){
	double acting_radius = (double)(m_module * m_num_teeth)/2;
	double outside_radius = acting_radius + (m_addendum_multiplier*m_module + m_addendum_offset);
	gp_Trsf mat = make_matrix(m_pos.Location(), m_pos.XDirection(), m_pos.YDirection());
	gp_Pnt p[4];
	p[0] = gp_Pnt(m_pos.Location().XYZ() + gp_XYZ(outside_radius, outside_radius, 0.0));
	p[1] = gp_Pnt(m_pos.Location().XYZ() + gp_XYZ(-outside_radius, outside_radius, 0.0));
	p[2] = gp_Pnt(m_pos.Location().XYZ() + gp_XYZ(-outside_radius, -outside_radius, 0.0));
	p[3] = gp_Pnt(m_pos.Location().XYZ() + gp_XYZ(outside_radius, -outside_radius, 0.0));
	for(int i = 0; i<4; i++)
	{
		p[i].Transform(mat);
		box.Insert(p[i].X(), p[i].Y(), p[i].Z());
	}
}
开发者ID:play113,项目名称:swer,代码行数:15,代码来源:HGear.cpp

示例15: GetBox

void HDimension::GetBox(CBox &box)
{
	gp_Pnt vt(0, 0, 0);
	vt.Transform(m_trsf);
	double p[3];
	extract(vt, p);
	box.Insert(p);

	wxString text = MakeText();
	float width, height;
	if(!wxGetApp().get_text_size(text, &width, &height))return;

	gp_Pnt point[3];
	point[0] = gp_Pnt(width, 0, 0);
	point[1] = gp_Pnt(0, -height, 0);
	point[2] = gp_Pnt(width, -height, 0);

	for(int i = 0; i<3; i++)
	{
		point[i].Transform(m_trsf);
		extract(point[i], p);
		box.Insert(p);
	}
}
开发者ID:CarlosGS,项目名称:heekscad,代码行数:24,代码来源:HDimension.cpp


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