BOOL EllipseRecordHandler::ReadEllipseComplex(CXaraFileRecord *pCXaraFileRecord) { BOOL ok = TRUE; NodeRegularShape *pEllipse; DocCoord CentrePoint; DocCoord MajorAxis; DocCoord MinorAxis; pEllipse = new NodeRegularShape; if (ok) ok = SetupShape(pEllipse); if (ok) ok = SetIsCircular(pEllipse, TRUE); if (ok) ok = pCXaraFileRecord->ReadCoord(&CentrePoint); if (ok) ok = SetCentrePoint(pEllipse, CentrePoint); if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MajorAxis,0,0); if (ok) ok = SetMajorAxis(pEllipse, MajorAxis); if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MinorAxis,0,0); if (ok) ok = SetMinorAxis(pEllipse, MinorAxis); if (ok) ok = InvalidateCache(pEllipse); if (ok) ok = InsertNode(pEllipse); return ok; }
BOOL RectangleRecordHandler::ReadRectangleComplexRoundedReformed(CXaraFileRecord *pCXaraFileRecord) { BOOL ok = TRUE; NodeRegularShape * pRectangle; DocCoord MajorAxis; DocCoord MinorAxis; Matrix TransformMatrix; double Curvature; pRectangle = new NodeRegularShape; if (ok) ok = SetupShape(pRectangle); if (ok) ok = SetNumberOfSides(pRectangle, NumberOfSides); if (ok) ok = SetIsRounded(pRectangle, TRUE); if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MajorAxis,0,0); if (ok) ok = SetMajorAxis(pRectangle, MajorAxis); if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MinorAxis,0,0); if (ok) ok = SetMinorAxis(pRectangle, MinorAxis); if (ok) ok = pCXaraFileRecord->ReadMatrix(&TransformMatrix); if (ok) ok = SetTransformMatrix(pRectangle, TransformMatrix); if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&Curvature); if (ok) ok = SetCurvature(pRectangle, Curvature); if (ok) ok = pCXaraFileRecord->ReadPath(&(pRectangle->EdgePath1)); if (ok) ok = InvalidateCache(pRectangle); if (ok) ok = InsertNode(pRectangle); return ok; }
BOOL RectangleRecordHandler::ReadRectangleComplexRounded(CXaraFileRecord *pCXaraFileRecord) { BOOL ok = TRUE; NodeRegularShape * pRectangle; DocCoord CentrePoint; DocCoord MajorAxis; DocCoord MinorAxis; double Curvature; pRectangle = new NodeRegularShape; if (ok) ok = SetupShape(pRectangle); if (ok) ok = SetNumberOfSides(pRectangle, NumberOfSides); if (ok) ok = SetIsRounded(pRectangle, TRUE); if (ok) ok = pCXaraFileRecord->ReadCoord(&CentrePoint); if (ok) ok = SetCentrePoint(pRectangle, CentrePoint); if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MajorAxis,0,0); if (ok) ok = SetMajorAxis(pRectangle, MajorAxis); if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MinorAxis,0,0); if (ok) ok = SetMinorAxis(pRectangle, MinorAxis); if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&Curvature); if (ok) ok = SetCurvature(pRectangle, Curvature); if (ok) ok = InvalidateCache(pRectangle); if (ok) ok = InsertNode(pRectangle); return ok; }
// sets the height and width of the shape. if this function gets called, we assume that the shape has // no rotation or skew, so the MajorAxis = (0, Height), MinorAxis = (Width, 0) BOOL RegularShapeRecordHandler::SetHeightAndWidth(NodeRegularShape *pShape, const INT32 & Height, const INT32 & Width) { ERROR2IF(pShape==NULL, FALSE, "parameter pShape == NULL"); SetMajorAxis(pShape, DocCoord(0, Height/2)); SetMinorAxis(pShape, DocCoord(Width/2, 0)); return TRUE; }
BOOL RegularShapeRecordHandler::ReadShapeGeneralPhase1(CXaraFileRecord *pCXaraFileRecord) { BOOL ok = TRUE; NodeRegularShape * pShape; BYTE Flags; UINT16 NumberOfSides; DocCoord UTCentrePoint; DocCoord MajorAxis; DocCoord MinorAxis; Matrix TransformMatrix; double StellationRadius; double StellationOffset; double PrimaryCurvature; double SecondaryCurvature; pShape = new NodeRegularShape; if (ok) ok = SetupShape(pShape); if (ok) ok = pCXaraFileRecord->ReadBYTE(&Flags); if (ok) ok = SetFlags(pShape, Flags); if (ok) ok = pCXaraFileRecord->ReadUINT16(&NumberOfSides); if (ok) ok = SetNumberOfSides(pShape, NumberOfSides); if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&UTCentrePoint,0,0); if (ok) ok = SetUTCentrePoint(pShape, UTCentrePoint); if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MajorAxis,0,0); if (ok) ok = SetMajorAxis(pShape, MajorAxis); if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MinorAxis,0,0); if (ok) ok = SetMinorAxis(pShape, MinorAxis); if (ok) ok = pCXaraFileRecord->ReadMatrix(&TransformMatrix); if (ok) ok = SetTransformMatrix(pShape, TransformMatrix); if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&StellationRadius); if (ok) ok = SetStellationRadius(pShape, StellationRadius); if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&StellationOffset); if (ok) ok = SetStellationOffset(pShape, StellationOffset); if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&PrimaryCurvature); if (ok) ok = SetPrimaryCurvature(pShape, PrimaryCurvature); if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&SecondaryCurvature); if (ok) ok = SetSecondaryCurvature(pShape, SecondaryCurvature); if (ok) ok = pCXaraFileRecord->ReadPath(&(pShape->EdgePath1)); if (ok) ok = pCXaraFileRecord->ReadPath(&(pShape->EdgePath2)); if (ok) ok = InvalidateCache(pShape); if (ok) ok = InsertNode(pShape); return ok; }
BOOL RectangleRecordHandler::ReadRectangleComplexRoundedStellatedReformed(CXaraFileRecord *pCXaraFileRecord) { BOOL ok = TRUE; NodeRegularShape * pRectangle; DocCoord MajorAxis; DocCoord MinorAxis; Matrix TransformMatrix; double StellationRadius; double StellationOffset; double PrimaryCurvature; double SecondaryCurvature; pRectangle = new NodeRegularShape; if (ok) ok = SetupShape(pRectangle); if (ok) ok = SetNumberOfSides(pRectangle, NumberOfSides); if (ok) ok = SetIsRounded(pRectangle, TRUE); if (ok) ok = SetIsStellated(pRectangle, TRUE); if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MajorAxis,0,0); if (ok) ok = SetMajorAxis(pRectangle, MajorAxis); if (ok) ok = pCXaraFileRecord->ReadCoordTrans(&MinorAxis,0,0); if (ok) ok = SetMinorAxis(pRectangle, MinorAxis); if (ok) ok = pCXaraFileRecord->ReadMatrix(&TransformMatrix); if (ok) ok = SetTransformMatrix(pRectangle, TransformMatrix); if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&StellationRadius); if (ok) ok = SetStellationRadius(pRectangle, StellationRadius); if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&StellationOffset); if (ok) ok = SetStellationOffset(pRectangle, StellationOffset); if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&PrimaryCurvature); if (ok) ok = SetPrimaryCurvature(pRectangle, PrimaryCurvature); if (ok) ok = pCXaraFileRecord->ReadDOUBLE(&SecondaryCurvature); if (ok) ok = SetSecondaryCurvature(pRectangle, SecondaryCurvature); if (ok) ok = pCXaraFileRecord->ReadPath(&(pRectangle->EdgePath1)); if (ok) ok = pCXaraFileRecord->ReadPath(&(pRectangle->EdgePath2)); if (ok) ok = InvalidateCache(pRectangle); if (ok) ok = InsertNode(pRectangle); return ok; }