DxfHatch.java 1013 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package com.fdkankan.dxf.generate.model;
  2. import com.fdkankan.dxf.generate.model.base.BaseDxfEntity;
  3. import com.fdkankan.dxf.generate.util.DxfLineBuilder;
  4. import lombok.Getter;
  5. /**
  6. * @author YTZJJ
  7. */
  8. @Getter
  9. public class DxfHatch extends BaseDxfEntity {
  10. private DxfSolid dxfSolid;
  11. public static DxfHatch buildHatchBy(BaseDxfEntity dxfCircle) {
  12. DxfHatch dxfHatch = new DxfHatch();
  13. dxfHatch.dxfSolid = new DxfSolid();
  14. dxfHatch.dxfSolid.setDxfEntity(dxfCircle);
  15. dxfHatch.color = dxfCircle.getSolidColor() == null ? dxfCircle.getColor() : dxfCircle.getSolidColor();
  16. dxfHatch.alpha = dxfCircle.getSolidAlpha();
  17. return dxfHatch;
  18. }
  19. @Override
  20. protected String getChildDxfStr() {
  21. return DxfLineBuilder.build().append(10, 0.0).append(20, 0.0).append(30, 0.0).append(210, 0.0).append(220, 0.0).append(230, 1.0).append(dxfSolid.getDxfStr()).toString();
  22. }
  23. @Override
  24. public String getEntityName() {
  25. return "HATCH";
  26. }
  27. @Override
  28. public String getEntityClassName() {
  29. return "AcDbHatch";
  30. }
  31. }