-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathAnalysisDialogConduit.cpp
More file actions
58 lines (51 loc) · 1.62 KB
/
AnalysisDialogConduit.cpp
File metadata and controls
58 lines (51 loc) · 1.62 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
// Copyright (c) 1993-2018 Robert McNeel & Associates. All rights reserved.
// Licensed under the MIT license. See LICENSE file in the project root for full license information.
// AnalysisDialogConduit.cpp
#include "StdAfx.h"
#include "AnalysisDialog.h"
#include "AnalysisDialogConduit.h"
CAnalysisDialogConduit::CAnalysisDialogConduit()
: CRhinoDisplayConduit(CSupportChannels::SC_DRAWOBJECT | CSupportChannels::SC_PREDRAWOBJECTS, false),
m_dialog(nullptr)
{
m_color = RhinoApp().AppSettings().AppearanceSettings().SelectedObjectColor();
}
void CAnalysisDialogConduit::Attach(const CAnalysisDialog* dialog)
{
m_dialog = dialog;
}
bool CAnalysisDialogConduit::ExecConduit(CRhinoDisplayPipeline& dp, UINT nActiveChannel, bool& bTerminateChannel)
{
if (nActiveChannel == CSupportChannels::SC_PREDRAWOBJECTS)
{
if (nullptr != m_dialog)
{
if (!dp.DisplayAttrs()->m_bShadeSurface)
{
for (int i = 0; i < m_dialog->m_meshes.Count(); i++)
{
ON_Mesh* mesh = m_dialog->m_meshes[i];
if (nullptr != mesh)
dp.DrawWireframeMesh(*mesh, m_color);
}
}
else
{
for (int i = 0; i < m_dialog->m_meshes.Count(); i++)
{
ON_Mesh* mesh = m_dialog->m_meshes[i];
if (nullptr != mesh)
dp.DrawShadedMesh(*mesh);
}
}
}
}
if (nActiveChannel == CSupportChannels::SC_DRAWOBJECT)
{
const CRhinoObject* obj = m_pChannelAttrs->m_pObject;
if (obj && m_dialog && m_dialog->m_objects.Search(obj->Attributes().m_uuid) >= 0)
m_pChannelAttrs->m_bDrawObject = false;
return true;
}
return true;
}