Files
Slnkdwf/SlnkDWFCom/SLNKSymbol.cpp
Jos Groot Lipman e267e9587c V4.27 09-09-2021
- FCLT#63646 Lijndikte van symbolen kunnen zetten
 - FCLT#68480 Geen TIFF ondersteuning meer

svn path=/Slnkdwf/trunk/; revision=52980
2021-09-09 15:03:04 +00:00

95 lines
2.0 KiB
C++

// SLNKSymbol.cpp : Implementation of CSLNKSymbol
#include "stdafx.h"
#include "SLNKSymbol.h"
#include "SLNKContour.h"
// CSLNKSymbol
STDMETHODIMP CSLNKSymbol::InterfaceSupportsErrorInfo(REFIID riid)
{
static const IID* arr[] =
{
&IID_IWhipFile
};
for (int i=0; i < sizeof(arr) / sizeof(arr[0]); i++)
{
if (InlineIsEqualGUID(*arr[i],riid))
return S_OK;
}
return S_FALSE;
}
void CSLNKSymbol::SetImpl(CSLNKSymbolImpl * pSLNKSymbol)
{
m_SLNKSymbol = pSLNKSymbol;
}
STDMETHODIMP CSLNKSymbol::get_Scale(DOUBLE* pVal)
{
(*pVal) = m_SLNKSymbol->m_Scale;
return S_OK;
}
STDMETHODIMP CSLNKSymbol::put_Scale(DOUBLE newVal)
{
m_SLNKSymbol->m_Scale = newVal;
return S_OK;
}
STDMETHODIMP CSLNKSymbol::get_Rotation(LONG* pVal)
{
(*pVal) = m_SLNKSymbol->m_Rotation;
return S_OK;
}
STDMETHODIMP CSLNKSymbol::put_Rotation(LONG newVal)
{
long rotation = (newVal%360+360)%360; // Normaliseren
// if (rotation%90 != 0)
// return myAtlReportError (GetObjectCLSID(), "ERROR Symbol rotation must be 0/90/180/270.");
m_SLNKSymbol->m_Rotation = newVal;
return S_OK;
}
STDMETHODIMP CSLNKSymbol::get_Contour(ISLNKContour** pVal)
{
CSLNKContourImpl *contour= &m_SLNKSymbol->m_SLNKContour;
CComObject<CSLNKContour> *theContour;
HRESULT hr = CComObject<CSLNKContour>::CreateInstance(&theContour);
if(FAILED(hr)) return hr;
theContour->AddRef();
hr = theContour->QueryInterface(IID_ISLNKContour, (void **)pVal);
if(FAILED(hr)) return hr;
theContour->SetParent(m_parent_iWhipFile); // Zelfde parent maar
theContour->Release();
theContour->SetImpl(contour); // Heel belangrijk: zet de implementatie waar we een interface op bieden
return S_OK;
}
STDMETHODIMP CSLNKSymbol::SetColor(ULONG rgb, BYTE Alpha /*=255*/)
{
int b=rgb%256;
int g=(rgb>>8)%256;
int r=(rgb>>16)%256;
m_SLNKSymbol->m_Color.set(r, g, b, Alpha);
m_SLNKSymbol->m_ColorSet = true;
return S_OK;
}
STDMETHODIMP CSLNKSymbol::SetLineweight(DOUBLE newVal)
{
m_SLNKSymbol->m_Lineweight = newVal;
return S_OK;
}