minor changes (format + move class in stl package )
This commit is contained in:
295
ArtLogJavaFormat.xml
Normal file
295
ArtLogJavaFormat.xml
Normal file
@@ -0,0 +1,295 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<profiles version="12">
|
||||
<profile kind="CodeFormatterProfile" name="ArtLog" version="12">
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_javadoc_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indentation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.disabling_tag" value="@formatter:off"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_enum_constants" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_imports" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_after_package" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_root_tags" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.enabling_tag" value="@formatter:on"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.enumIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_block" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.line_length" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_on_off_tags" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_method_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_binary_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_lambda_body" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.compact_else_if" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.problem.assertIdentifier" value="error"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_binary_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_ellipsis" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_line_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.align_type_members_on_columns" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_assignment" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_conditional_expression" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_block_in_case" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_header" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode" value="enabled"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_method_declaration" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_wrapped_lines" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_resources_in_try" value="80"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.source" value="1.8"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.size" value="4"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_source_code" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_field" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer" value="2"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_method" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.codegen.targetPlatform" value="1.8"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_switch" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_type_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_html" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_compact_if" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_empty_lines" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_unary_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_label" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_member_type" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.format_block_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line" value="false"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_statements_compare_to_body" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.alignment_for_multiple_fields" value="16"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_array_initializer" value="end_of_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_before_binary_operator" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.compiler.compliance" value="1.8"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_enum_constant" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.brace_position_for_type_declaration" value="next_line"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_before_package" value="0"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_lambda_arrow" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.join_lines_in_comments" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.comment.indent_parameter_description" value="true"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement" value="insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.tabulation.char" value="space"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.blank_lines_between_import_groups" value="1"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.lineSplit" value="120"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation" value="do not insert"/>
|
||||
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch" value="insert"/>
|
||||
</profile>
|
||||
</profiles>
|
||||
42
build.xml
Normal file
42
build.xml
Normal file
@@ -0,0 +1,42 @@
|
||||
<project name="artloglaby" default="dist" basedir="/home/philippe/artisanlogiciel/code/java/laby_github">
|
||||
<description>
|
||||
simple example build file
|
||||
</description>
|
||||
<!-- set global properties for this build -->
|
||||
<property name="src" location="java"/>
|
||||
<property name="build" location="build"/>
|
||||
<property name="dist" location="dist"/>
|
||||
|
||||
<target name="init">
|
||||
<!-- Create the time stamp -->
|
||||
<tstamp/>
|
||||
<!-- Create the build directory structure used by compile -->
|
||||
<mkdir dir="${build}"/>
|
||||
</target>
|
||||
|
||||
<target name="compile" depends="init"
|
||||
description="compile the source " >
|
||||
<!-- Compile the java code from ${src} into ${build} -->
|
||||
<javac srcdir="${src}" destdir="${build}"/>
|
||||
</target>
|
||||
|
||||
<target name="dist" depends="compile"
|
||||
description="generate the distribution" >
|
||||
<!-- Create the distribution directory -->
|
||||
<mkdir dir="${dist}/lib"/>
|
||||
|
||||
<!-- Put everything in ${build} into the artloglaby-0.0.1.jar file ( ${DSTAMP} not used yet )-->
|
||||
<jar jarfile="${dist}/lib/artloglaby-0.0.1.jar" basedir="${build}">
|
||||
<manifest>
|
||||
<attribute name="Main-Class" value="org.artisanlogiciel.games.Display"/>
|
||||
</manifest>
|
||||
</jar>
|
||||
</target>
|
||||
|
||||
<target name="clean"
|
||||
description="clean up" >
|
||||
<!-- Delete the ${build} and ${dist} directory trees -->
|
||||
<delete dir="${build}"/>
|
||||
<delete dir="${dist}"/>
|
||||
</target>
|
||||
</project>
|
||||
40
documentation/rawformat
Normal file
40
documentation/rawformat
Normal file
@@ -0,0 +1,40 @@
|
||||
|
||||
Maze/Labyrinth raw format extension .raw
|
||||
|
||||
Model of labyrinth storing only paths not walls. wall are regenerated later on based on adjacent paths.
|
||||
each position (x,y) stores what move can be done from here to go do deeper path.
|
||||
a node is tagged OPEN and contained in openList if all moves from its position have not been resolved
|
||||
a node is tagged CLOSED when fully processed
|
||||
|
||||
position is (x,y)
|
||||
|
||||
See org.artisanlogiciel.games.WallsProvider
|
||||
|
||||
file starts with
|
||||
'LAB0'
|
||||
32bits Width
|
||||
32bits Height
|
||||
|
||||
Width * ( 16bits )
|
||||
*
|
||||
Height.
|
||||
|
||||
|
||||
/** WARNING don't change those values, they are used as it is for optimisation */
|
||||
private final static short FLAGLENGTH=7;
|
||||
private final static short CLEAR=0; // mandatory 0 since array creation is initialized with 0.
|
||||
private final static short HORIZONTAL=1;
|
||||
private final static short VERTICAL=2;
|
||||
private final static short DIRECTION=4; // could we get rid of that to free one bit for other purpose ?
|
||||
private final static short POSITIVE=8;
|
||||
private final static short NEGATIVE=16;
|
||||
private final static short OPEN=32; // can be reused once generation is completed
|
||||
private final static short CLOSED=64; // can be reused once generation is completed
|
||||
private final static short LEFT=Brick.LEFT<<FLAGLENGTH|DIRECTION|HORIZONTAL|NEGATIVE;
|
||||
private final static short DOWN=Brick.DOWN<<FLAGLENGTH|DIRECTION|VERTICAL|POSITIVE;
|
||||
private final static short RIGHT=Brick.RIGHT<<FLAGLENGTH|DIRECTION|HORIZONTAL|POSITIVE;
|
||||
private final static short UP=Brick.UP<<FLAGLENGTH|DIRECTION|VERTICAL|NEGATIVE;
|
||||
private final static short ENTRY=Brick.ENTRY<<FLAGLENGTH; // flag when a wall should be open to access this.
|
||||
private final static short GOAL=Brick.GOAL<<FLAGLENGTH; // flag when a wall should be open to access this.
|
||||
private final static short SOLVED=64<<FLAGLENGTH; // flag when solution is on this path.
|
||||
private final static short FREE=128<<FLAGLENGTH; // free flag
|
||||
@@ -7,6 +7,7 @@ $(OUT):
|
||||
mkdir -p $(OUT)
|
||||
|
||||
clean:
|
||||
@find $(PACKAGE_DIR) -name "*.class" -type f -print0|xargs -0 rm 2>/dev/null && echo "cleaned classes in source"
|
||||
@find $(OUT) -name "*.class" -type f -print0|xargs -0 rm 2>/dev/null || echo "nothing to clean"
|
||||
|
||||
test:
|
||||
|
||||
@@ -10,14 +10,15 @@ a is 'H' or '.' or ' '
|
||||
bcd is 'H' or ' '
|
||||
|
||||
*/
|
||||
public class Brick {
|
||||
public class Brick
|
||||
{
|
||||
|
||||
public final static short LEFT=1;
|
||||
public final static short DOWN=2;
|
||||
public final static short RIGHT=4;
|
||||
public final static short UP=8;
|
||||
public final static short ENTRY=16;
|
||||
public final static short GOAL=32;
|
||||
public final static short LEFT = 1;
|
||||
public final static short DOWN = 2;
|
||||
public final static short RIGHT = 4;
|
||||
public final static short UP = 8;
|
||||
public final static short ENTRY = 16;
|
||||
public final static short GOAL = 32;
|
||||
|
||||
char a;
|
||||
char b;
|
||||
@@ -25,98 +26,88 @@ public class Brick {
|
||||
char d;
|
||||
short walls; // according to LabyModel.getWalls();
|
||||
|
||||
public Brick(char center, char right, char down, char downright,short walls)
|
||||
public Brick(char center, char right, char down, char downright, short walls)
|
||||
{
|
||||
a=center;
|
||||
b=right;
|
||||
c=down;
|
||||
d=downright;
|
||||
this.walls=walls;
|
||||
a = center;
|
||||
b = right;
|
||||
c = down;
|
||||
d = downright;
|
||||
this.walls = walls;
|
||||
}
|
||||
|
||||
public Brick(String up, String low, short walls)
|
||||
{
|
||||
a = up.charAt(0);
|
||||
b = up.charAt(1);
|
||||
c = low.charAt(0);
|
||||
d = low.charAt(1);
|
||||
this.walls=walls;
|
||||
a = up.charAt(0);
|
||||
b = up.charAt(1);
|
||||
c = low.charAt(0);
|
||||
d = low.charAt(1);
|
||||
this.walls = walls;
|
||||
}
|
||||
|
||||
private boolean check()
|
||||
{
|
||||
// Not Yet Implemented
|
||||
return false;
|
||||
// Not Yet Implemented
|
||||
return false;
|
||||
}
|
||||
|
||||
public String getUpString()
|
||||
{
|
||||
return "" + a + b;
|
||||
return "" + a + b;
|
||||
}
|
||||
|
||||
public String getLowString()
|
||||
{
|
||||
return "" + c + d;
|
||||
return "" + c + d;
|
||||
}
|
||||
|
||||
public static String getDirLine()
|
||||
{
|
||||
char dir[] = new char[16];
|
||||
String s="";
|
||||
|
||||
/*
|
||||
dir[LEFT | DOWN | RIGHT | UP]='O';
|
||||
dir[LEFT | DOWN | RIGHT]='U';
|
||||
dir[LEFT | UP | RIGHT]='M';
|
||||
dir[LEFT | UP | DOWN]='[';
|
||||
dir[RIGHT | UP | DOWN]=']';
|
||||
dir[UP | DOWN]='=';
|
||||
dir[LEFT | RIGHT]='|';
|
||||
dir[RIGHT | DOWN]='J';
|
||||
dir[LEFT | DOWN]='L';
|
||||
dir [LEFT | UP]='T';
|
||||
dir[UP | RIGHT]='7';
|
||||
dir[LEFT] = '!';
|
||||
dir[RIGHT] ='|';
|
||||
dir[DOWN]= '_';
|
||||
dir[UP]= '¨';
|
||||
dir[0]=' ';
|
||||
*/
|
||||
char dir[] = new char[16];
|
||||
String s = "";
|
||||
|
||||
dir[LEFT | DOWN | RIGHT | UP]='O';
|
||||
dir[LEFT | DOWN | RIGHT]='U';
|
||||
dir[LEFT | UP | RIGHT]='M';
|
||||
dir[LEFT | UP | DOWN]='[';
|
||||
dir[RIGHT | UP | DOWN]=']';
|
||||
dir[UP | DOWN]='=';
|
||||
dir[LEFT | RIGHT]=226;
|
||||
dir[RIGHT | DOWN]='J';
|
||||
dir[LEFT | DOWN]='L';
|
||||
dir [LEFT | UP]=169;
|
||||
dir[UP | RIGHT]=170;
|
||||
dir[LEFT] = 173;
|
||||
dir[RIGHT] ='|';
|
||||
dir[DOWN]= '_';
|
||||
dir[UP]= '¨';
|
||||
dir[0]=' ';
|
||||
|
||||
for (int i=0;i< 16; i++)
|
||||
{
|
||||
s=s+dir[i];
|
||||
}
|
||||
/*
|
||||
* dir[LEFT | DOWN | RIGHT | UP]='O'; dir[LEFT | DOWN | RIGHT]='U';
|
||||
* dir[LEFT | UP | RIGHT]='M'; dir[LEFT | UP | DOWN]='['; dir[RIGHT | UP
|
||||
* | DOWN]=']'; dir[UP | DOWN]='='; dir[LEFT | RIGHT]='|'; dir[RIGHT |
|
||||
* DOWN]='J'; dir[LEFT | DOWN]='L'; dir [LEFT | UP]='T'; dir[UP |
|
||||
* RIGHT]='7'; dir[LEFT] = '!'; dir[RIGHT] ='|'; dir[DOWN]= '_';
|
||||
* dir[UP]= '¨'; dir[0]=' ';
|
||||
*/
|
||||
|
||||
return s;
|
||||
dir[LEFT | DOWN | RIGHT | UP] = 'O';
|
||||
dir[LEFT | DOWN | RIGHT] = 'U';
|
||||
dir[LEFT | UP | RIGHT] = 'M';
|
||||
dir[LEFT | UP | DOWN] = '[';
|
||||
dir[RIGHT | UP | DOWN] = ']';
|
||||
dir[UP | DOWN] = '=';
|
||||
dir[LEFT | RIGHT] = 226;
|
||||
dir[RIGHT | DOWN] = 'J';
|
||||
dir[LEFT | DOWN] = 'L';
|
||||
dir[LEFT | UP] = 169;
|
||||
dir[UP | RIGHT] = 170;
|
||||
dir[LEFT] = 173;
|
||||
dir[RIGHT] = '|';
|
||||
dir[DOWN] = '_';
|
||||
dir[UP] = '¨';
|
||||
dir[0] = ' ';
|
||||
|
||||
for (int i = 0; i < 16; i++)
|
||||
{
|
||||
s = s + dir[i];
|
||||
}
|
||||
|
||||
return s;
|
||||
|
||||
}
|
||||
|
||||
public char getChar()
|
||||
{
|
||||
// return getDirLine().charAt(walls & 0xFFF0);
|
||||
return getDirLine().charAt(walls);
|
||||
// return getDirLine().charAt(walls & 0xFFF0);
|
||||
return getDirLine().charAt(walls);
|
||||
}
|
||||
|
||||
public short getWalls()
|
||||
{
|
||||
return walls;
|
||||
return walls;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,8 @@ import javax.swing.KeyStroke;
|
||||
import javax.swing.event.ChangeEvent;
|
||||
import javax.swing.event.ChangeListener;
|
||||
|
||||
import org.artisanlogiciel.games.stl.Wall3d;
|
||||
|
||||
/**
|
||||
* Display
|
||||
**/
|
||||
|
||||
@@ -2,105 +2,116 @@ package org.artisanlogiciel.games;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
class LabyMap
|
||||
implements WallsProvider
|
||||
class LabyMap implements WallsProvider
|
||||
{
|
||||
|
||||
Brick[][] tileMap;
|
||||
LinkedList<Position> exits = new LinkedList<Position>();
|
||||
LinkedList<Position> exits = new LinkedList<Position>();
|
||||
|
||||
public LabyMap(Brick[][] tileMap, LinkedList<Position> exits)
|
||||
{
|
||||
this.tileMap = tileMap;
|
||||
this.exits = exits;
|
||||
this.tileMap = tileMap;
|
||||
this.exits = exits;
|
||||
}
|
||||
|
||||
Brick getAt(int x, int y)
|
||||
{
|
||||
return tileMap[x][y];
|
||||
return tileMap[x][y];
|
||||
}
|
||||
|
||||
public short getWalls(int x, int y)
|
||||
{
|
||||
return getAt(x,y).getWalls();
|
||||
return getAt(x, y).getWalls();
|
||||
}
|
||||
|
||||
|
||||
public int getWidth()
|
||||
{
|
||||
return tileMap[0].length;
|
||||
return tileMap[0].length;
|
||||
}
|
||||
|
||||
public int getHeight()
|
||||
{
|
||||
return tileMap.length;
|
||||
return tileMap.length;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
int entryX = -1;
|
||||
int entryY = -1;
|
||||
for ( Position exit: exits )
|
||||
{
|
||||
if ( exit.getX() == -1 )
|
||||
{
|
||||
entryY = exit.getY();
|
||||
}
|
||||
if ( exit.getY() == -1 )
|
||||
{
|
||||
entryX= exit.getX();
|
||||
}
|
||||
}
|
||||
String laby="H";
|
||||
for ( int x=0; x < tileMap.length; x ++) {
|
||||
if ( entryX == x ) { laby += " H" ; }
|
||||
else { laby+="HH";}
|
||||
}
|
||||
laby+="\n";
|
||||
for ( int y=0; y < tileMap[0].length; y++)
|
||||
{
|
||||
if ( entryY == y ) { laby += ">";}
|
||||
else { laby += "H"; }
|
||||
for ( int x=0; x < tileMap.length; x ++)
|
||||
{
|
||||
laby+= tileMap[x][y].getUpString();
|
||||
}
|
||||
laby+="\n";
|
||||
laby += "H";
|
||||
for ( int x=0; x < tileMap.length; x ++)
|
||||
{
|
||||
laby+= tileMap[x][y].getLowString();
|
||||
}
|
||||
laby+="\n";
|
||||
}
|
||||
return laby;
|
||||
int entryX = -1;
|
||||
int entryY = -1;
|
||||
for (Position exit : exits)
|
||||
{
|
||||
if (exit.getX() == -1)
|
||||
{
|
||||
entryY = exit.getY();
|
||||
}
|
||||
if (exit.getY() == -1)
|
||||
{
|
||||
entryX = exit.getX();
|
||||
}
|
||||
}
|
||||
String laby = "H";
|
||||
for (int x = 0; x < tileMap.length; x++)
|
||||
{
|
||||
if (entryX == x)
|
||||
{
|
||||
laby += " H";
|
||||
}
|
||||
else
|
||||
{
|
||||
laby += "HH";
|
||||
}
|
||||
}
|
||||
laby += "\n";
|
||||
for (int y = 0; y < tileMap[0].length; y++)
|
||||
{
|
||||
if (entryY == y)
|
||||
{
|
||||
laby += ">";
|
||||
}
|
||||
else
|
||||
{
|
||||
laby += "H";
|
||||
}
|
||||
for (int x = 0; x < tileMap.length; x++)
|
||||
{
|
||||
laby += tileMap[x][y].getUpString();
|
||||
}
|
||||
laby += "\n";
|
||||
laby += "H";
|
||||
for (int x = 0; x < tileMap.length; x++)
|
||||
{
|
||||
laby += tileMap[x][y].getLowString();
|
||||
}
|
||||
laby += "\n";
|
||||
}
|
||||
return laby;
|
||||
}
|
||||
|
||||
|
||||
public String toShortString()
|
||||
{
|
||||
int entryX = -1;
|
||||
int entryY = -1;
|
||||
for ( Position exit: exits )
|
||||
{
|
||||
if ( exit.getX() == -1 )
|
||||
{
|
||||
entryY = exit.getY();
|
||||
}
|
||||
if ( exit.getY() == -1 )
|
||||
{
|
||||
entryX= exit.getX();
|
||||
}
|
||||
}
|
||||
String laby="";
|
||||
for ( int y=0; y < tileMap[0].length; y++)
|
||||
{
|
||||
for ( int x=0; x < tileMap.length; x ++)
|
||||
{
|
||||
laby+= "" + tileMap[x][y].getChar();
|
||||
}
|
||||
laby+="\n";
|
||||
}
|
||||
return laby;
|
||||
int entryX = -1;
|
||||
int entryY = -1;
|
||||
for (Position exit : exits)
|
||||
{
|
||||
if (exit.getX() == -1)
|
||||
{
|
||||
entryY = exit.getY();
|
||||
}
|
||||
if (exit.getY() == -1)
|
||||
{
|
||||
entryX = exit.getX();
|
||||
}
|
||||
}
|
||||
String laby = "";
|
||||
for (int y = 0; y < tileMap[0].length; y++)
|
||||
{
|
||||
for (int x = 0; x < tileMap.length; x++)
|
||||
{
|
||||
laby += "" + tileMap[x][y].getChar();
|
||||
}
|
||||
laby += "\n";
|
||||
}
|
||||
return laby;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -6,50 +6,50 @@ import java.util.LinkedList;
|
||||
public class Main
|
||||
{
|
||||
|
||||
public WallsProvider generate(int width,int height, int maxdepth, MazeResolutionListener listener)
|
||||
public WallsProvider generate(int width, int height, int maxdepth, MazeResolutionListener listener)
|
||||
{
|
||||
LabyModel model = new LabyModel(width, height,maxdepth, new java.util.Random());
|
||||
model.generateWithEntry(0, 0);
|
||||
LinkedList<Position> exits = new LinkedList<Position>();
|
||||
model.addEntryOrExit(-1,0);
|
||||
model.addEntryOrExit(width,height -1);
|
||||
if ( ! model.check() )
|
||||
{
|
||||
System.out.println("Check failed");
|
||||
}
|
||||
model.resolve(width-1,height-1,listener);
|
||||
return model;
|
||||
LabyModel model = new LabyModel(width, height, maxdepth, new java.util.Random());
|
||||
model.generateWithEntry(0, 0);
|
||||
LinkedList<Position> exits = new LinkedList<Position>();
|
||||
model.addEntryOrExit(-1, 0);
|
||||
model.addEntryOrExit(width, height - 1);
|
||||
if (!model.check())
|
||||
{
|
||||
System.out.println("Check failed");
|
||||
}
|
||||
model.resolve(width - 1, height - 1, listener);
|
||||
return model;
|
||||
}
|
||||
|
||||
public LabyMap generate2(int width,int height, int maxdepth)
|
||||
public LabyMap generate2(int width, int height, int maxdepth)
|
||||
{
|
||||
LabyModel model = new LabyModel(width, height,maxdepth, new java.util.Random( 1024L));
|
||||
model.generateWithEntry(0, 0);
|
||||
LinkedList<Position> exits = new LinkedList<Position>();
|
||||
model.addEntryOrExit(-1,0);
|
||||
model.addEntryOrExit(width,height -1);
|
||||
System.out.println(model.toLabyMap().toString());
|
||||
if ( ! model.check() )
|
||||
{
|
||||
System.out.println("Check failed");
|
||||
}
|
||||
model.debugOut();
|
||||
model.resolve(width-1,height-1,null);
|
||||
LabyMap labyMap =model.toLabyMap();
|
||||
return labyMap;
|
||||
LabyModel model = new LabyModel(width, height, maxdepth, new java.util.Random(1024L));
|
||||
model.generateWithEntry(0, 0);
|
||||
LinkedList<Position> exits = new LinkedList<Position>();
|
||||
model.addEntryOrExit(-1, 0);
|
||||
model.addEntryOrExit(width, height - 1);
|
||||
System.out.println(model.toLabyMap().toString());
|
||||
if (!model.check())
|
||||
{
|
||||
System.out.println("Check failed");
|
||||
}
|
||||
model.debugOut();
|
||||
model.resolve(width - 1, height - 1, null);
|
||||
LabyMap labyMap = model.toLabyMap();
|
||||
return labyMap;
|
||||
}
|
||||
|
||||
public static void main(String pArgs[])
|
||||
{
|
||||
System.out.println("enter width height and maxdepth");
|
||||
Scanner console = new Scanner(System.in);
|
||||
int width = console.nextInt();
|
||||
int height = console.nextInt();
|
||||
int maxdepth = console.nextInt();
|
||||
Main m= new Main();
|
||||
LabyMap map = m.generate2(width,height,maxdepth);
|
||||
System.out.println(map.toShortString());
|
||||
System.out.println(map.toString());
|
||||
System.out.println(Brick.getDirLine());
|
||||
System.out.println("enter width height and maxdepth");
|
||||
Scanner console = new Scanner(System.in);
|
||||
int width = console.nextInt();
|
||||
int height = console.nextInt();
|
||||
int maxdepth = console.nextInt();
|
||||
Main m = new Main();
|
||||
LabyMap map = m.generate2(width, height, maxdepth);
|
||||
System.out.println(map.toShortString());
|
||||
System.out.println(map.toString());
|
||||
System.out.println(Brick.getDirLine());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.artisanlogiciel.games;
|
||||
|
||||
/**
|
||||
MazeCreationListener
|
||||
* MazeCreationListener
|
||||
**/
|
||||
interface MazeCreationListener
|
||||
{
|
||||
|
||||
@@ -3,22 +3,24 @@ package org.artisanlogiciel.games;
|
||||
import java.io.File;
|
||||
|
||||
/**
|
||||
MazeParams was autogenerated by ./generate_newclass.sh
|
||||
* MazeParams was autogenerated by ./generate_newclass.sh
|
||||
**/
|
||||
public interface MazeParams
|
||||
{
|
||||
public int getWidth();
|
||||
|
||||
public int getHeight();
|
||||
|
||||
public int getMaxDepth();
|
||||
|
||||
/**
|
||||
@return name of Maze, used for creating filename at saving time
|
||||
* @return name of Maze, used for creating filename at saving time
|
||||
*/
|
||||
public String getName();
|
||||
|
||||
/**
|
||||
@return directory owning where to save a maze
|
||||
* @return directory owning where to save a maze
|
||||
*/
|
||||
public File getSaveDir();
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -3,13 +3,13 @@ package org.artisanlogiciel.games;
|
||||
import java.util.LinkedList;
|
||||
|
||||
/**
|
||||
MazeResolutionListener used as interface between resolver and (mostly) GUI
|
||||
* MazeResolutionListener used as interface between resolver and (mostly) GUI
|
||||
**/
|
||||
public interface MazeResolutionListener
|
||||
{
|
||||
|
||||
public boolean notifySearch(Position pPosition);
|
||||
|
||||
|
||||
public void notifySearchError(String error);
|
||||
|
||||
public void notifyCompletion(LinkedList<Position> solvedPath);
|
||||
|
||||
@@ -1,38 +1,41 @@
|
||||
package org.artisanlogiciel.games;
|
||||
|
||||
public class Position {
|
||||
public class Position
|
||||
{
|
||||
private int x, y;
|
||||
private int depth;
|
||||
|
||||
public Position(int x, int y,int depth){
|
||||
this.x=x;
|
||||
this.y=y;
|
||||
this.depth=depth;
|
||||
public Position(int x, int y, int depth)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.depth = depth;
|
||||
}
|
||||
|
||||
public Position(int x, int y){
|
||||
this.x=x;
|
||||
this.y=y;
|
||||
this.depth=0;
|
||||
public Position(int x, int y)
|
||||
{
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.depth = 0;
|
||||
}
|
||||
|
||||
public int getX()
|
||||
{
|
||||
return this.x;
|
||||
return this.x;
|
||||
}
|
||||
|
||||
public int getY()
|
||||
{
|
||||
return this.y;
|
||||
return this.y;
|
||||
}
|
||||
|
||||
public int getDepth()
|
||||
{
|
||||
return depth;
|
||||
return depth;
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
return "(" + x + "," + y + ")" + "/" + depth ;
|
||||
return "(" + x + "," + y + ")" + "/" + depth;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,220 +0,0 @@
|
||||
package org.artisanlogiciel.games;
|
||||
|
||||
import java.util.Scanner;
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
Wall3d to create walls in 3d
|
||||
South, West North East...
|
||||
**/
|
||||
public class Wall3d
|
||||
{
|
||||
// 4 triangles in 2 dim space reused 3 times
|
||||
final static int BASE[][][] = {{{0,0},{1,0},{0,1}},{{1,0},{1,1},{0,1}},{{0,0},{1,0},{1,1}},{{0,0},{1,1},{0,1}}};
|
||||
|
||||
final static short X=1;
|
||||
final static short Y=2;
|
||||
final static short Z=4;
|
||||
|
||||
// final static short AXIS[][]= {{X,Y},{-Z,Y},{X,Y},{Z,Y},{X,-Z},{X,-Z}};
|
||||
final static short AXIS[][]= {{X,Y,0},{Z,Y,0},{X,Y,1},{Z,Y,1},{X,Z,0},{X,Z,1}};
|
||||
|
||||
public final static Wall3d South = new Wall3d(10,1,10,0,0,0);
|
||||
public final static Wall3d West = new Wall3d(1,10,10,0,0,0);
|
||||
public final static Wall3d North = new Wall3d(10,1,10,0,10,0);
|
||||
public final static Wall3d East = new Wall3d(1,10,10,10,0,0);
|
||||
|
||||
int triangle[][][] = null;
|
||||
|
||||
public Wall3d(int t[][][])
|
||||
{
|
||||
triangle = t;
|
||||
}
|
||||
|
||||
public Wall3d(Wall3d origin, int dx, int dy, int dz)
|
||||
{
|
||||
triangle=origin.translate(dx,dy,dz);
|
||||
}
|
||||
|
||||
Wall3d(int xl, int yl, int zl, int dx, int dy, int dz)
|
||||
{
|
||||
int f=0;
|
||||
triangle = new int[12][3][3];
|
||||
int[] factor = {xl,yl,zl};
|
||||
int[] translate = {dx,dy,dz};
|
||||
for (int i=0; i < 12; i++)
|
||||
{
|
||||
// point in a triangle
|
||||
for (int p=0; p<3; p++)
|
||||
{
|
||||
short uaxis=0;
|
||||
for (int axis=0; axis <2; axis++)
|
||||
{
|
||||
short caxis = AXIS[i/2][axis];
|
||||
if ( caxis >0 )
|
||||
{
|
||||
f=1;
|
||||
}
|
||||
else
|
||||
if ( caxis <0 )
|
||||
{
|
||||
f=-1;
|
||||
caxis=(short) -caxis;
|
||||
}
|
||||
uaxis|=caxis;
|
||||
if ( caxis == X )
|
||||
{
|
||||
caxis=0;
|
||||
}
|
||||
else if ( caxis == Y)
|
||||
{
|
||||
caxis=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
caxis=2;
|
||||
}
|
||||
// if ( f == 0 )
|
||||
// {
|
||||
// System.out.println("ERROR");
|
||||
// }
|
||||
//System.out.println("i " + i + " p " + p + " a " + caxis + " , " + BASE[i%4][p][axis] );
|
||||
triangle[i][p][caxis]=translate[caxis] + BASE[i%4][p][axis]*f*factor[caxis];
|
||||
}
|
||||
if ( (uaxis & X) == 0 )
|
||||
{
|
||||
uaxis=0;
|
||||
}
|
||||
else if ( (uaxis & Y) == 0)
|
||||
{
|
||||
uaxis=1;
|
||||
}
|
||||
else
|
||||
{
|
||||
uaxis=2;
|
||||
}
|
||||
triangle[i][p][uaxis]=translate[uaxis] + AXIS[i/2][2]*factor[uaxis];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int[][][] translate(int dx, int dy, int dz)
|
||||
{
|
||||
int[] translate = {dx,dy,dz};
|
||||
int t[][][] = new int[12][3][3];
|
||||
|
||||
for (int i=0; i < 12; i++)
|
||||
{
|
||||
// point in a triangle
|
||||
for (int p=0; p<3; p++)
|
||||
{
|
||||
for (int axis=0; axis <3; axis++)
|
||||
{
|
||||
t[i][p][axis]=translate[axis] + triangle[i][p][axis];
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
String s = "";
|
||||
for (int t=0; t<12; t++)
|
||||
{
|
||||
s+="facet normal 0 0 0\nouter loop\n";
|
||||
for (int p=0; p<3; p++)
|
||||
{
|
||||
s+="vertex";
|
||||
for (int a=0; a<3; a++)
|
||||
{
|
||||
// s+=" t "+ t + " p " + p + " a " + a + "=" + triangle[t][p][a];
|
||||
s+= " " + triangle[t][p][a];
|
||||
}
|
||||
s+="\n";
|
||||
}
|
||||
s=s+"endloop\nendfacet\n";
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public static void prepare()
|
||||
{
|
||||
System.out.println(South.toString());
|
||||
System.out.println(East.toString());
|
||||
System.out.println(North.toString());
|
||||
System.out.println(West.toString());
|
||||
}
|
||||
|
||||
public static void streamWallsOut(String name, WallsProvider provider, OutputStream stream)
|
||||
throws IOException
|
||||
{
|
||||
int width = provider.getWidth();
|
||||
int height = provider.getHeight();
|
||||
int xl = 10;
|
||||
int yl = 10;
|
||||
int zl = 10;
|
||||
|
||||
// WARNING DOWN - UP reversed ( in 2D Y is oriented to lower, in 3D it is to upper ).
|
||||
stream.write(("solid " + name + "\n").getBytes());
|
||||
for (int x=0; x<width; x++)
|
||||
{
|
||||
short walls = provider.getWalls(x,0);
|
||||
if ( (walls & Brick.UP) != 0 )
|
||||
{
|
||||
stream.write(new Wall3d(South,x*xl,0,0).toString().getBytes());
|
||||
}
|
||||
if ( (walls & Brick.LEFT) != 0 )
|
||||
{
|
||||
stream.write(new Wall3d(West,x*xl,0,0).toString().getBytes());
|
||||
}
|
||||
}
|
||||
|
||||
for (int y=0; y<height; y++)
|
||||
{
|
||||
short walls = provider.getWalls(0,y);
|
||||
if ( (walls & Brick.LEFT) != 0 )
|
||||
{
|
||||
stream.write(new Wall3d(West,0,y*yl,0).toString().getBytes());
|
||||
}
|
||||
for (int x=0; x<width; x++)
|
||||
{
|
||||
// south and east
|
||||
walls = provider.getWalls(x,y);
|
||||
if ( (walls & Brick.DOWN) != 0 )
|
||||
{
|
||||
stream.write(new Wall3d(North,x*xl,y*yl,0).toString().getBytes());
|
||||
}
|
||||
if ( (walls & Brick.RIGHT) != 0)
|
||||
{
|
||||
stream.write(new Wall3d(East,x*xl,y*yl,0).toString().getBytes());
|
||||
}
|
||||
}
|
||||
}
|
||||
stream.write("endsolid wall\n\n".getBytes());
|
||||
}
|
||||
|
||||
public static void main(String args[]) {
|
||||
|
||||
Scanner console = new Scanner(System.in);
|
||||
int xl = console.nextInt();
|
||||
int yl = console.nextInt();
|
||||
int zl = console.nextInt();
|
||||
|
||||
int dx = console.nextInt();
|
||||
int dy = console.nextInt();
|
||||
int dz = console.nextInt();
|
||||
|
||||
String s="solid wall\n";
|
||||
|
||||
Wall3d instance=new Wall3d(xl,yl,zl, dx,dy,dz);
|
||||
|
||||
prepare();
|
||||
|
||||
s+="endsolid wall\n\n";
|
||||
System.out.println(s);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
package org.artisanlogiciel.games;
|
||||
|
||||
/**
|
||||
WallsProvider provide a Walls representation
|
||||
* WallsProvider provide a Walls representation
|
||||
**/
|
||||
public interface WallsProvider
|
||||
{
|
||||
@@ -11,17 +11,10 @@ public interface WallsProvider
|
||||
int getHeight();
|
||||
|
||||
/**
|
||||
See Brick
|
||||
|
||||
Will set bits :
|
||||
3 2 1 0
|
||||
(8)(4)(2)(1)
|
||||
^ > v <
|
||||
U R D L
|
||||
p i o e
|
||||
g w f
|
||||
h n t
|
||||
t
|
||||
* See Brick
|
||||
*
|
||||
* Will set bits : 3 2 1 0 (8)(4)(2)(1) ^ > v < U R D L p i o e g w f h n t
|
||||
* t
|
||||
**/
|
||||
public short getWalls(int x, int y);
|
||||
}
|
||||
|
||||
225
java/org/artisanlogiciel/games/stl/Wall3d.java
Normal file
225
java/org/artisanlogiciel/games/stl/Wall3d.java
Normal file
@@ -0,0 +1,225 @@
|
||||
package org.artisanlogiciel.games.stl;
|
||||
|
||||
import java.util.Scanner;
|
||||
|
||||
import org.artisanlogiciel.games.Brick;
|
||||
import org.artisanlogiciel.games.WallsProvider;
|
||||
|
||||
import java.io.OutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
/**
|
||||
* Wall3d to create walls in 3d for stl conversion South, West North East...
|
||||
**/
|
||||
public class Wall3d
|
||||
{
|
||||
// 4 triangles in 2 dim space reused 3 times
|
||||
final static int BASE[][][] = { { { 0, 0 }, { 1, 0 }, { 0, 1 } }, { { 1, 0 }, { 1, 1 }, { 0, 1 } },
|
||||
{ { 0, 0 }, { 1, 0 }, { 1, 1 } }, { { 0, 0 }, { 1, 1 }, { 0, 1 } } };
|
||||
|
||||
final static short X = 1;
|
||||
final static short Y = 2;
|
||||
final static short Z = 4;
|
||||
|
||||
// final static short AXIS[][]= {{X,Y},{-Z,Y},{X,Y},{Z,Y},{X,-Z},{X,-Z}};
|
||||
final static short AXIS[][] = { { X, Y, 0 }, { Z, Y, 0 }, { X, Y, 1 }, { Z, Y, 1 }, { X, Z, 0 }, { X, Z, 1 } };
|
||||
|
||||
public final static Wall3d South = new Wall3d(10, 1, 10, 0, 0, 0);
|
||||
public final static Wall3d West = new Wall3d(1, 10, 10, 0, 0, 0);
|
||||
public final static Wall3d North = new Wall3d(10, 1, 10, 0, 10, 0);
|
||||
public final static Wall3d East = new Wall3d(1, 10, 10, 10, 0, 0);
|
||||
|
||||
int triangle[][][] = null;
|
||||
|
||||
public Wall3d(int t[][][])
|
||||
{
|
||||
triangle = t;
|
||||
}
|
||||
|
||||
public Wall3d(Wall3d origin, int dx, int dy, int dz)
|
||||
{
|
||||
triangle = origin.translate(dx, dy, dz);
|
||||
}
|
||||
|
||||
Wall3d(int xl, int yl, int zl, int dx, int dy, int dz)
|
||||
{
|
||||
int f = 0;
|
||||
triangle = new int[12][3][3];
|
||||
int[] factor = { xl, yl, zl };
|
||||
int[] translate = { dx, dy, dz };
|
||||
for (int i = 0; i < 12; i++)
|
||||
{
|
||||
// point in a triangle
|
||||
for (int p = 0; p < 3; p++)
|
||||
{
|
||||
short uaxis = 0;
|
||||
for (int axis = 0; axis < 2; axis++)
|
||||
{
|
||||
short caxis = AXIS[i / 2][axis];
|
||||
if (caxis > 0)
|
||||
{
|
||||
f = 1;
|
||||
}
|
||||
else if (caxis < 0)
|
||||
{
|
||||
f = -1;
|
||||
caxis = (short) -caxis;
|
||||
}
|
||||
uaxis |= caxis;
|
||||
if (caxis == X)
|
||||
{
|
||||
caxis = 0;
|
||||
}
|
||||
else if (caxis == Y)
|
||||
{
|
||||
caxis = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
caxis = 2;
|
||||
}
|
||||
// if ( f == 0 )
|
||||
// {
|
||||
// System.out.println("ERROR");
|
||||
// }
|
||||
// System.out.println("i " + i + " p " + p + " a " + caxis +
|
||||
// " , " + BASE[i%4][p][axis] );
|
||||
triangle[i][p][caxis] = translate[caxis] + BASE[i % 4][p][axis] * f * factor[caxis];
|
||||
}
|
||||
if ((uaxis & X) == 0)
|
||||
{
|
||||
uaxis = 0;
|
||||
}
|
||||
else if ((uaxis & Y) == 0)
|
||||
{
|
||||
uaxis = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
uaxis = 2;
|
||||
}
|
||||
triangle[i][p][uaxis] = translate[uaxis] + AXIS[i / 2][2] * factor[uaxis];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public int[][][] translate(int dx, int dy, int dz)
|
||||
{
|
||||
int[] translate = { dx, dy, dz };
|
||||
int t[][][] = new int[12][3][3];
|
||||
|
||||
for (int i = 0; i < 12; i++)
|
||||
{
|
||||
// point in a triangle
|
||||
for (int p = 0; p < 3; p++)
|
||||
{
|
||||
for (int axis = 0; axis < 3; axis++)
|
||||
{
|
||||
t[i][p][axis] = translate[axis] + triangle[i][p][axis];
|
||||
}
|
||||
}
|
||||
}
|
||||
return t;
|
||||
|
||||
}
|
||||
|
||||
public String toString()
|
||||
{
|
||||
String s = "";
|
||||
for (int t = 0; t < 12; t++)
|
||||
{
|
||||
s += "facet normal 0 0 0\nouter loop\n";
|
||||
for (int p = 0; p < 3; p++)
|
||||
{
|
||||
s += "vertex";
|
||||
for (int a = 0; a < 3; a++)
|
||||
{
|
||||
// s+=" t "+ t + " p " + p + " a " + a + "=" +
|
||||
// triangle[t][p][a];
|
||||
s += " " + triangle[t][p][a];
|
||||
}
|
||||
s += "\n";
|
||||
}
|
||||
s = s + "endloop\nendfacet\n";
|
||||
}
|
||||
return s;
|
||||
}
|
||||
|
||||
public static void prepare()
|
||||
{
|
||||
System.out.println(South.toString());
|
||||
System.out.println(East.toString());
|
||||
System.out.println(North.toString());
|
||||
System.out.println(West.toString());
|
||||
}
|
||||
|
||||
public static void streamWallsOut(String name, WallsProvider provider, OutputStream stream) throws IOException
|
||||
{
|
||||
int width = provider.getWidth();
|
||||
int height = provider.getHeight();
|
||||
int xl = 10;
|
||||
int yl = 10;
|
||||
int zl = 10;
|
||||
|
||||
// WARNING DOWN - UP reversed ( in 2D Y is oriented to lower, in 3D it
|
||||
// is to upper ).
|
||||
stream.write(("solid " + name + "\n").getBytes());
|
||||
for (int x = 0; x < width; x++)
|
||||
{
|
||||
short walls = provider.getWalls(x, 0);
|
||||
if ((walls & Brick.UP) != 0)
|
||||
{
|
||||
stream.write(new Wall3d(South, x * xl, 0, 0).toString().getBytes());
|
||||
}
|
||||
if ((walls & Brick.LEFT) != 0)
|
||||
{
|
||||
stream.write(new Wall3d(West, x * xl, 0, 0).toString().getBytes());
|
||||
}
|
||||
}
|
||||
|
||||
for (int y = 0; y < height; y++)
|
||||
{
|
||||
short walls = provider.getWalls(0, y);
|
||||
if ((walls & Brick.LEFT) != 0)
|
||||
{
|
||||
stream.write(new Wall3d(West, 0, y * yl, 0).toString().getBytes());
|
||||
}
|
||||
for (int x = 0; x < width; x++)
|
||||
{
|
||||
// south and east
|
||||
walls = provider.getWalls(x, y);
|
||||
if ((walls & Brick.DOWN) != 0)
|
||||
{
|
||||
stream.write(new Wall3d(North, x * xl, y * yl, 0).toString().getBytes());
|
||||
}
|
||||
if ((walls & Brick.RIGHT) != 0)
|
||||
{
|
||||
stream.write(new Wall3d(East, x * xl, y * yl, 0).toString().getBytes());
|
||||
}
|
||||
}
|
||||
}
|
||||
stream.write("endsolid wall\n\n".getBytes());
|
||||
}
|
||||
|
||||
public static void main(String args[])
|
||||
{
|
||||
|
||||
Scanner console = new Scanner(System.in);
|
||||
int xl = console.nextInt();
|
||||
int yl = console.nextInt();
|
||||
int zl = console.nextInt();
|
||||
|
||||
int dx = console.nextInt();
|
||||
int dy = console.nextInt();
|
||||
int dz = console.nextInt();
|
||||
|
||||
String s = "solid wall\n";
|
||||
|
||||
Wall3d instance = new Wall3d(xl, yl, zl, dx, dy, dz);
|
||||
|
||||
prepare();
|
||||
|
||||
s += "endsolid wall\n\n";
|
||||
System.out.println(s);
|
||||
}
|
||||
}
|
||||
BIN
lab/lab100x100.raw
Normal file
BIN
lab/lab100x100.raw
Normal file
Binary file not shown.
858903
lab/lab100x100.stl
Normal file
858903
lab/lab100x100.stl
Normal file
File diff suppressed because it is too large
Load Diff
BIN
lab/lab12x35.raw
Normal file
BIN
lab/lab12x35.raw
Normal file
Binary file not shown.
39567
lab/lab12x35.stl
Normal file
39567
lab/lab12x35.stl
Normal file
File diff suppressed because it is too large
Load Diff
16963
lab/lab20x20.gcode
Normal file
16963
lab/lab20x20.gcode
Normal file
File diff suppressed because it is too large
Load Diff
BIN
lab/lab20x20.raw
Normal file
BIN
lab/lab20x20.raw
Normal file
Binary file not shown.
37467
lab/lab20x20.stl
Normal file
37467
lab/lab20x20.stl
Normal file
File diff suppressed because it is too large
Load Diff
BIN
lab/lab30x30.raw
Normal file
BIN
lab/lab30x30.raw
Normal file
Binary file not shown.
81399
lab/lab30x30.stl
Normal file
81399
lab/lab30x30.stl
Normal file
File diff suppressed because it is too large
Load Diff
BIN
lab/lab40x40.raw
Normal file
BIN
lab/lab40x40.raw
Normal file
Binary file not shown.
141879
lab/lab40x40.stl
Normal file
141879
lab/lab40x40.stl
Normal file
File diff suppressed because it is too large
Load Diff
BIN
lab/lab50x50.raw
Normal file
BIN
lab/lab50x50.raw
Normal file
Binary file not shown.
219663
lab/lab50x50.stl
Normal file
219663
lab/lab50x50.stl
Normal file
File diff suppressed because it is too large
Load Diff
BIN
lab/lab60x36.raw
Normal file
BIN
lab/lab60x36.raw
Normal file
Binary file not shown.
190767
lab/lab60x36.stl
Normal file
190767
lab/lab60x36.stl
Normal file
File diff suppressed because it is too large
Load Diff
BIN
lab/lab98x98.raw
Normal file
BIN
lab/lab98x98.raw
Normal file
Binary file not shown.
825135
lab/lab98x98.stl
Normal file
825135
lab/lab98x98.stl
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user