Betere coördinaten markers in fac_verify
Font ook resetten voor allereerste symbool Symbolen commentaar iets duidelijker in ASCII dwf svn path=/Slnkdwf/trunk/; revision=48107
This commit is contained in:
@@ -36,6 +36,20 @@ WT_Result CSLNKSymbolImpl::serialize (WT_File & file, WT_Units & units,
|
|||||||
{
|
{
|
||||||
ATLASSERT(symbdef != NULL);
|
ATLASSERT(symbdef != NULL);
|
||||||
|
|
||||||
|
WT_Color().serialize(file); // Op de default zetten.
|
||||||
|
file.desired_rendition().color() = file.rendition().color() = WT_Color();
|
||||||
|
|
||||||
|
WT_Fill().serialize(file); // Ook op de default zetten.
|
||||||
|
file.desired_rendition().fill() = file.rendition().fill() = WT_Fill();
|
||||||
|
|
||||||
|
WT_Font default_font;
|
||||||
|
default_font.width_scale() = 0; // Triggert FONT_WIDTH_SCALE_BIT bitje zetten
|
||||||
|
default_font.rotation() = 0;
|
||||||
|
default_font.height() = 0;
|
||||||
|
default_font.flags() = 0;
|
||||||
|
default_font.serialize(file); // Op de default zetten.
|
||||||
|
file.desired_rendition().font() = file.rendition().font() = default_font;
|
||||||
|
|
||||||
WT_Point3D insertion(m_dwgX, m_dwgY);
|
WT_Point3D insertion(m_dwgX, m_dwgY);
|
||||||
|
|
||||||
if (symbdef->m_hasBitmap)
|
if (symbdef->m_hasBitmap)
|
||||||
@@ -177,8 +191,8 @@ WT_Result CSLNKSymbolImpl::serialize (WT_File & file, WT_Units & units,
|
|||||||
WT_Fill().serialize(file); // Ook op de default zetten.
|
WT_Fill().serialize(file); // Ook op de default zetten.
|
||||||
file.desired_rendition().fill() = file.rendition().fill() = WT_Fill();
|
file.desired_rendition().fill() = file.rendition().fill() = WT_Fill();
|
||||||
|
|
||||||
WT_Font().serialize(file); // Ook op de default zetten.
|
default_font.serialize(file); // Ook op de default zetten.
|
||||||
file.desired_rendition().font() = file.rendition().font() = WT_Font();
|
file.desired_rendition().font() = file.rendition().font() = default_font;
|
||||||
|
|
||||||
file.heuristics().set_apply_transform(WD_False); // Hebben we al rechtstreeks op de contour gedaan
|
file.heuristics().set_apply_transform(WD_False); // Hebben we al rechtstreeks op de contour gedaan
|
||||||
m_SLNKContour.serialize(file, node_num, true, forFind, scale);
|
m_SLNKContour.serialize(file, node_num, true, forFind, scale);
|
||||||
|
|||||||
@@ -834,7 +834,7 @@ bool CWhipFile::GenerateSymbols(myWT_File &my_file)
|
|||||||
m_hintScale, m_forFind, scale);
|
m_hintScale, m_forFind, scale);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
CString s; s.Format("About to insert symbol %s", symbol->m_symbolName);
|
CString s; s.Format("About to insert symbol %d %s (%s)", m_next_node_num, symbol->m_SLNKContour.m_Key, symbol->m_symbolName);
|
||||||
comment(my_file, s);
|
comment(my_file, s);
|
||||||
symbol->serialize(my_file, m_contunits, m_SLNKSymbolDefinitions[symbol->m_symbolName],
|
symbol->serialize(my_file, m_contunits, m_SLNKSymbolDefinitions[symbol->m_symbolName],
|
||||||
m_next_node_num,
|
m_next_node_num,
|
||||||
@@ -1232,6 +1232,12 @@ STDMETHODIMP CWhipFile::DefineW2DSymbol(BSTR symbolName, BSTR WhipPath, ISLNKCon
|
|||||||
{
|
{
|
||||||
symb = new CSLNKSymbolDefinition(CString(WhipPath));
|
symb = new CSLNKSymbolDefinition(CString(WhipPath));
|
||||||
}
|
}
|
||||||
|
catch (WT_Result::Enum e)
|
||||||
|
{
|
||||||
|
CString err;
|
||||||
|
err.Format("\nInternal error WT_Result::Enum %d", e);
|
||||||
|
return myAtlReportError(GetObjectCLSID(), "\nCWhipFile::DefineW2DSymbol('%ls')\n%s", (LPCSTR)WhipPath, err);
|
||||||
|
}
|
||||||
catch (CString &err)
|
catch (CString &err)
|
||||||
{
|
{
|
||||||
return myAtlReportError (GetObjectCLSID(), "Error defining symbol %ls file %ls:%s\n", symbolName, WhipPath, err);
|
return myAtlReportError (GetObjectCLSID(), "Error defining symbol %ls file %ls:%s\n", symbolName, WhipPath, err);
|
||||||
|
|||||||
@@ -326,48 +326,34 @@ int CWhip2DCImpl::Paint(VARIANT_BOOL forceBW, LONG markers /* = 0 */)
|
|||||||
|
|
||||||
// Het lijkt aantrekkelijk te tonen waar overflow optreedt
|
// Het lijkt aantrekkelijk te tonen waar overflow optreedt
|
||||||
// de tussen-DWF is echter al richting origin verplaatst, daarna speelt overflow niet meer
|
// de tussen-DWF is echter al richting origin verplaatst, daarna speelt overflow niet meer
|
||||||
|
int skipLP = 1; // toon op skipLP afstand telkens een marker
|
||||||
if (markers > 1) // dan altijd tonen
|
if (markers > 1) // dan altijd tonen
|
||||||
{
|
skipLP = max(myRound(markers / m_State.m_mul), 1);
|
||||||
CRect clip;
|
|
||||||
GetClipBox(m_State.myDC, &clip); // Zichtbaar deel op scherm
|
|
||||||
|
|
||||||
for (int x = clip.TopLeft().x; x <= clip.BottomRight().x; x+= markers)
|
if (markers > 1 || m_State.m_mul > 10.0)
|
||||||
for (int y = clip.TopLeft().y; y <= clip.BottomRight().y; y+= markers)
|
|
||||||
{
|
|
||||||
CPoint pt(x, y);
|
|
||||||
WT_Logical_Point ptl(m_State.LPToDWF(pt));
|
|
||||||
|
|
||||||
SetPixel(m_State.myDC, pt.x, pt.y, RGB(128, 128, 128));
|
|
||||||
// Altijd DWF-coordinaten
|
|
||||||
CString txt;
|
|
||||||
txt.Format("%d", ptl.m_x);
|
|
||||||
TextOut(m_State.myDC, pt.x + 5, pt.y, txt, txt.GetLength());
|
|
||||||
txt.Format("%d", ptl.m_y);
|
|
||||||
TextOut(m_State.myDC, pt.x + 5, pt.y + 10, txt, txt.GetLength());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (m_State.m_mul > 10.0)
|
|
||||||
{
|
{
|
||||||
CRect clip;
|
CRect clip;
|
||||||
GetClipBox(m_State.myDC, &clip); // Zichtbaar deel op scherm
|
GetClipBox(m_State.myDC, &clip); // Zichtbaar deel op scherm
|
||||||
|
|
||||||
WT_Logical_Point topleft(m_State.LPToDWF(clip.TopLeft()));
|
WT_Logical_Point topleft(m_State.LPToDWF(clip.TopLeft()));
|
||||||
WT_Logical_Point botright(m_State.LPToDWF(clip.BottomRight()));
|
WT_Logical_Point botright(m_State.LPToDWF(clip.BottomRight()));
|
||||||
for (int x = topleft.m_x; x <= botright.m_x; x++)
|
for (int x = topleft.m_x; x <= botright.m_x; x += skipLP)
|
||||||
for (int y = topleft.m_y; y >= botright.m_y; y--)
|
for (int y = topleft.m_y; y >= botright.m_y; y-= skipLP)
|
||||||
{
|
{
|
||||||
CPoint pt = m_State.DWFToLP(WT_Logical_Point(x, y));
|
CPoint pt = m_State.DWFToLP(WT_Logical_Point(x, y));
|
||||||
SetPixel(m_State.myDC, pt.x, pt.y, RGB(128, 128, 128));
|
// Bij sterk inzoomen tonen we DWF-coordinaten
|
||||||
// Bij nog sterker inzoomen tonen we DWF-coordinaten
|
if (markers > 1 || m_State.m_mul > 80.0)
|
||||||
if (m_State.m_mul > 80.0)
|
|
||||||
{
|
{
|
||||||
|
m_State.Marker(pt);
|
||||||
CString txt;
|
CString txt;
|
||||||
txt.Format("%d", x);
|
txt.Format("%d", x);
|
||||||
TextOut(m_State.myDC, pt.x + 5, pt.y, txt, txt.GetLength());
|
TextOut(m_State.myDC, pt.x + 10, pt.y, txt, txt.GetLength());
|
||||||
txt.Format("%d", y);
|
txt.Format("%d", y);
|
||||||
TextOut(m_State.myDC, pt.x + 5, pt.y + 10, txt, txt.GetLength());
|
TextOut(m_State.myDC, pt.x + 10, pt.y + 10, txt, txt.GetLength());
|
||||||
}
|
}
|
||||||
}
|
else // simpele pixel
|
||||||
|
SetPixel(m_State.myDC, pt.x, pt.y, RGB(128, 128, 128));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
SelectObject(m_State.myDC, oldfont);
|
SelectObject(m_State.myDC, oldfont);
|
||||||
DeleteObject(fnt);
|
DeleteObject(fnt);
|
||||||
|
|||||||
Reference in New Issue
Block a user