コード例 #1
0
ファイル: cmdscript1.cpp プロジェクト: caffeina/PluginMonti
static bool selectobjectbyuuid_s( CRhinoDoc& doc, const wchar_t* uuid_str, bool bredraw )
{
  bool rc = false;
  CRhinoLayerTable& layer_table = doc.m_layer_table;
  ON_Layer currentLayer;
  const CRhinoLayer& current_layer = layer_table.CurrentLayer();

		  int layer_index = layer_table.CurrentLayerIndex();
		  const CRhinoLayer& layer2 = layer_table[layer_index];

		  ON_SimpleArray<CRhinoObject*> obj_list;
		  int j, obj_count = doc.LookupObject( layer2, obj_list );
		  for( j = 0; j < obj_count; j++ )
		  {
				 CRhinoObject* obj = obj_list[j];
				 ON_wString prova55 =	obj->Attributes().m_name;
				 if( obj->Attributes().m_name!= uuid_str)
				 {
					 ::RhinoApp().Print( L"nome oggetto non trovato");
				 }
				 else
				 {::RhinoApp().Print( L"trovato");
				 
				 rc = true;}

				
				CRhinoObjRef ref(obj);
				if( obj  )
  {
    obj->Select( true );
    if( bredraw )
      doc.Redraw();
  }
  if( obj_count )
  {	
	if (obj_count >1)
		::RhinoApp().Print( L"THERE ARE MORE OBJETC");
	}
  };  
  return rc;
}
コード例 #2
0
void CMarmaladeEventWatcher::OnModifyObjectAttributes(CRhinoDoc& doc, CRhinoObject& object, const CRhinoObjectAttributes& old_attributes)
{
	if (!object.IsMeshable(ON::render_mesh))
		return;

	const CRhinoObjectAttributes& new_attributes = object.Attributes();

	if (old_attributes.MaterialSource() == new_attributes.MaterialSource())
	{
		if ((new_attributes.MaterialSource() == ON::material_from_object) && (old_attributes.m_material_index != new_attributes.m_material_index))
		{
			m_bRenderMeshModified = true;
		}
		else
		if ((new_attributes.MaterialSource() == ON::material_from_layer) && (old_attributes.m_layer_index != new_attributes.m_layer_index))
		{
			m_bRenderMeshModified = true;
		}
	}
	else
	{
		m_bRenderMeshModified = true;
	}
}