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


C++ Geometry::GetName方法代码示例

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


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

示例1: OnEditGeometry

void GeometryListView::OnEditGeometry() 
// Called when user clicks "Edit" in the geometry list.
{
	// Figure out which geometry item to edit.
	int	index = GetSelectedItemIndex();
	if (index < 0) {
		// No item selected, so we don't know what to delete...
		return;
	}
	if (index == 0) {
		// Can't edit null geometry.
		return;
	}

	// Get the geometry object to edit.
	Geometry*	g = GetDocument()->GetGeometry(index);
	if (g == NULL) return;

	// Call edit dialog box.
	GeometryPropertiesDialog d;
	d.SetName(g->GetName());
	d.SetFilename(g->GetFilename()); 
	d.SetComment(g->GetComment());

	if (d.DoModal() != IDCANCEL) {
		// Apply the changes.
		g->SetName(d.GetName());
		g->SetFilename(d.GetFilename());
		g->SetComment(d.GetComment());

		GetDocument()->SetModifiedFlag();
		GetDocument()->UpdateAllViews(NULL);
	}
}
开发者ID:Echelon9,项目名称:shreditor,代码行数:34,代码来源:GeometryListView.cpp

示例2: report

// report function 
void report(Geometry &obj){

	cout << "----- Geometry Report -----\n";
	cout << "   Name:    " << obj.GetName() << endl;
	cout << "   Type:    " << obj.GetType() << endl; 
	cout << "   Volume:  " << obj.ComputeVolume()  << endl;
	cout << "   Surface: " << obj.ComputeSurface() << endl;
	cout << "---------------------------\n";
}
开发者ID:bogoli,项目名称:CS1410,代码行数:10,代码来源:Main.cpp

示例3: Update

void GeometryListView::Update() 
// Rebuild the list of geometry resources.
{
//	CPropertyPage::OnUpdate(pSender, lHint, pHint);

	// TODO: Add extra initialization here
	CTerrainDoc*	doc = GetDocument();
	Geometry*	g = doc->GetGeometryList();
	int	GeometryCount = doc->GetGeometryCount();
	CListCtrl*	list = &m_ListControl /* (CListCtrl*) GetDlgItem(IDC_GEOMETRYLIST) */;
	if (list->m_hWnd == NULL) return;

	// Setup the column headings.
	while (list->DeleteColumn(0)) ;

	LV_COLUMN	col;
	col.mask = LVCF_FMT | LVCF_SUBITEM | LVCF_TEXT | LVCF_WIDTH;
	col.fmt = LVCFMT_LEFT;

	// Name.
	col.pszText = "Name";
	col.iSubItem = 0;
	col.cx = 75;
	list->InsertColumn(0, &col);

	// Filename.
	col.iSubItem = 1;
	col.pszText = "Filename";
	col.cx = 100;
	list->InsertColumn(1, &col);

	// Comment.
	col.iSubItem = 2;
	col.pszText = "Comment";
	col.cx = 170;
	list->InsertColumn(2, &col);

	// Set the list items.
	list->DeleteAllItems();
	list->SetItemCount(GeometryCount);
	for (int i = 0; i < GeometryCount; i++, g = g->Next) {
		if (g == NULL) break;

		int index = list->InsertItem(i, g->GetName());
		list->SetItemText(index, 1, g->GetFilename());
		list->SetItemText(index, 2, g->GetComment());
		list->SetItemData(index, i);
	}
}
开发者ID:Echelon9,项目名称:shreditor,代码行数:49,代码来源:GeometryListView.cpp


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