コード例 #1
0
void CMarmaladeEventWatcher::OnReplaceObject(CRhinoDoc& doc, CRhinoObject& old_object, CRhinoObject& new_object)
{
	// TODO: CHECK FOR LIGHTS
	ON_SimpleArray<const ON_Mesh*> old_meshes, new_meshes;

	bool bOldMeshes = (old_object.GetMeshes(ON::render_mesh, old_meshes) < 1);
	bool bNewMeshes = (new_object.GetMeshes(ON::render_mesh, new_meshes) < 1);

	if (bOldMeshes)
	{
		if (new_object.IsMeshable(ON::render_mesh))
		{
			if (bNewMeshes)
			{
				m_bRenderMeshModified = true;
			}
			else
			{
				m_bRenderMeshDeleted = true;
			}
		} 
		else
		{
			m_bRenderMeshDeleted = true;
		}
	} 
	else
	if (bNewMeshes)
	{
		m_bRenderMeshAdded = true;
	} 
	else
	if (new_object.IsMeshable(ON::render_mesh))
	{
		m_bRenderMeshAdded = true;
	}
}
コード例 #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;
	}
}
コード例 #3
0
void CMarmaladeEventWatcher::OnUnDeleteObject(CRhinoDoc& doc, CRhinoObject& object)
{
	// TODO: CHECK FOR LIGHTS
	if (object.IsMeshable(ON::render_mesh))
		m_bRenderMeshAdded = true;
}